| 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/coaching_sites/usbusinessfundingsolutions.com/member/ |
Upload File : |
<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/phpCrypto.php');
$crypto = new phpCrypto();
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/dbconfig.php');
$db = db_connect('lc2synment_lc');
function time_left($str) {
$secs = strtotime($str) - time();
$minutes = floor($secs / 60);
$seconds = $secs % 60;
return str_pad($minutes,2,'0',STR_PAD_LEFT).':'.str_pad($seconds,2,'0',STR_PAD_LEFT).' mins';
}
function pretty_phone($str) {
$str = preg_replace('/[^0-9]/','',$str);
return '('.substr($str,0,3).') '.substr($str,3,3).'-'.substr($str,6);
}
if(!empty($_POST['action'])) {
if($_POST['action']=='save_cc_info') {
$errors = '';
if($_POST['payment_type']=='credit_card') {
if(empty($_POST['cc_num'])) {
$errors .= ($errors=='') ? 'You must enter a credit card number.' : "\n".'You must enter a credit card number.';
} else {
$_POST['cc_num'] = preg_replace('/[^0-9]/','',$_POST['cc_num']);
$_POST['cc_first_four'] = substr($_POST['cc_num'],0,4);
$_POST['cc_last_four'] = substr($_POST['cc_num'],-4);
$_POST['cc_num_masked'] = $crypto->encrypt(substr($_POST['cc_num'],0,6).'******'.substr($_POST['cc_num'],-4));
$_POST['cc_num'] = $crypto->encrypt($_POST['cc_num']);
}
if(empty($_POST['cc_exp_month'])) {
$errors .= ($errors=='') ? 'You must enter an expiration month.' : "\n".'You must enter an expiration month.';
}
if(empty($_POST['cc_exp_year'])) {
$errors .= ($errors=='') ? 'You must enter an expiration year.' : "\n".'You must enter an expiration year.';
}
if(($_POST['cc_exp_year'] < date('Y')) || ($_POST['cc_exp_year']==date('Y') && ($_POST['cc_exp_month']*1) < (date('m')*1))) {
$errors .= ($errors=='') ? 'The credit card expiration has expired.' : "\n".'The credit card expiration has expired.';
}
if(empty($_POST['cc_cvv'])) {
if(substr($_POST['cc_first_four'],0,1)!=3) {
$errors .= ($errors=='') ? 'You must enter an CVV number (3 digits on back of card).' : "\n".'You must enter an CVV number (3 digits on back of card).';
} else {
$errors .= ($errors=='') ? 'You must enter an CVV number (4 digits on front of card near the top right).' : "\n".'You must enter an CVV number (4 digits on front of card near the top right).';
}
} else {
$_POST['cc_cvv'] = $crypto->encrypt($_POST['cc_cvv']);
}
if(empty($_POST['name_as_appears'])) {
$errors .= ($errors=='') ? 'You must enter the name as it appears on the card.' : "\n".'You must enter the name as it appears on the card.';
}
if(empty($_POST['zip'])) {
$errors .= ($errors=='') ? 'You must enter the zip code.' : "\n".'You must enter the zip code.';
}
} else {
if(empty($_POST['check_routing_num'])) {
$errors .= ($errors=='') ? 'You must enter the routing number.' : "\n".'You must enter the routing number.';
}
if(empty($_POST['check_account_num'])) {
$errors .= ($errors=='') ? 'You must enter the account number.' : "\n".'You must enter the account number.';
}
$_POST['check_account_last_four'] = substr($_POST['check_account_num'],-4);
$_POST['check_account_num'] = $crypto->encrypt($_POST['check_account_num']);
}
if(!empty($errors)) {
die($errors);
}
$_POST['client_id'] = $_POST['rid'];
$payment_type = $_POST['payment_type'];
$nickname = ($payment_type=='check') ? 'check' : $_POST['cc_type'];
$db->query("INSERT INTO lc2synment_lc.payment_info
(
client_id
,payment_type
,nickname
,name_as_appears
,street_address
,city
,state
,zip
,cc_num
,cc_exp_month
,cc_exp_year
,cc_first_four
,cc_last_four
,cc_cvv
,date_created
,check_routing_num
,check_account_num
,check_account_last_four
)
VALUES (
'".$db->clean($_POST['client_id'])."',
'".$db->clean($payment_type)."',
'".$db->clean($nickname)."',
'".$db->clean($_POST['name_as_appears'])."',
'".$db->clean($_POST['street_address'])."',
'".$db->clean($_POST['city'])."',
'".$db->clean($_POST['state'])."',
'".$db->clean($_POST['zip'])."',
'".$db->clean($_POST['cc_num'])."',
'".$db->clean($_POST['cc_exp_month'])."',
'".$db->clean($_POST['cc_exp_year'])."',
'".$db->clean($_POST['cc_first_four'])."',
'".$db->clean($_POST['cc_last_four'])."',
'".$db->clean($_POST['cc_cvv'])."',
NOW(),
'".$db->clean($_POST['check_routing_num'])."',
'".$db->clean($_POST['check_account_num'])."',
'".$db->clean($_POST['check_account_last_four'])."'
)");
$new_id = $db->last_insert_id();
if(!empty($new_id)) {
//check if this is the first one
$is_first = $db->get_results("SELECT COUNT(*) as c FROM lc2synment_lc.payment_info WHERE client_id='".$db->clean($_POST['client_id'])."'");
if($is_first[0]->c==1) {
$db->query("UPDATE lc2synment_lc.orders
SET finance_recurring_payment_info_id='".$db->clean($new_id)."'
WHERE client_id='".$db->clean($_POST['client_id'])."'");
}
if($_POST['payment_type']=='credit_card') {
//Add/Update the customer vault (Initial Payments)
$client_res = $db->get_results("SELECT pi.*,r.email,r.phone_1
FROM lc2synment_lc.payment_info pi
LEFT JOIN lc2synment_lc.lc_reseller r ON r.id=pi.client_id
WHERE pi.id='".$db->clean($new_id)."'");
$client = $client_res[0];
$responses = array();
$ch = curl_init();
$c_url = "https://secure.networkmerchants.com/api/transact.php";
if($client->customer_vault_id==0) {
$query = "customer_vault=add_customer";
} else {
$query = "customer_vault=update_customer";
$query .= "&customer_vault_id=".$client->customer_vault_id;
}
$billing_address = $client->street_address;
$billing_city = $client->city;
$billing_state = $client->state;
$billing_zip = $client->zip;
$billing_phone = $client->phone_1;
$billing_email = $client->email;
if(!empty($client->name_as_appears)) {
$arr = explode(' ',$client->name_as_appears);
$billing_first = $arr[0];
$billing_last = str_replace($billing_first.' ','',$client->name_as_appears);
}
$query .= "&username=synegyproapi";
$query .= "&password=zZ49hjIGWi&";
// Sales Information
if(strpos($crypto->decrypt($client->cc_num),'*')===false) {
$query .= "ccnumber=" . urlencode($crypto->decrypt($client->cc_num)) . "&";
$real_cc_num = $crypto->decrypt($client->cc_num);
$client->cc_num = $crypto->encrypt(substr($real_cc_num,0,6).'******'.substr($real_cc_num,-4));
}
$query .= "ccexp=" . urlencode($client->cc_exp_month . substr($client->cc_exp_year,-2)) . "&";
// Order Information
$query .= "ipaddress=" . urlencode($client->ip_address) . "&";
$query .= "ponumber=" . urlencode($client->phone_1) . "&";
// Billing Information
$query .= "firstname=" . urlencode($billing_first) . "&";
$query .= "lastname=" . urlencode($billing_last) . "&";
$query .= "company=" . urlencode('') . "&";
$query .= "address1=" . urlencode($billing_address) . "&";
$query .= "address2=" . urlencode('') . "&";
$query .= "city=" . urlencode($billing_city) . "&";
$query .= "state=" . urlencode($billing_state) . "&";
$query .= "zip=" . urlencode($billing_zip) . "&";
$query .= "country=" . urlencode('US') . "&";
$query .= "phone=" . urlencode($client->phone_1) . "&";
$query .= "fax=" . urlencode('') . "&";
$query .= "email=" . urlencode($client->email) . "&";
$query .= "website=" . urlencode('') . "&";
// Shipping Information
$query .= "shipping_firstname=" . urlencode($client->first) . "&";
$query .= "shipping_lastname=" . urlencode($client->last) . "&";
$query .= "shipping_company=" . urlencode('') . "&";
$query .= "shipping_address1=" . urlencode($client->address1) . "&";
$query .= "shipping_address2=" . urlencode('') . "&";
$query .= "shipping_city=" . urlencode($client->city) . "&";
$query .= "shipping_state=" . urlencode($client->state) . "&";
$query .= "shipping_zip=" . urlencode($client->zip) . "&";
$query .= "shipping_country=" . urlencode('US') . "&";
$query .= "shipping_email=" . urlencode($client->email);
//var_dump($query);
curl_setopt($ch, CURLOPT_URL, $c_url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_POST, 1);
$data = curl_exec($ch);
curl_close($ch);
unset($ch);
$data = explode("&",$data);
for($i=0;$i<count($data);$i++) {
$rdata = explode("=",$data[$i]);
$responses[$rdata[0]] = $rdata[1];
}
//var_dump($data);
//var_dump($responses);
if(!empty($responses['customer_vault_id'])) {
$db->query("UPDATE lc2synment_lc.payment_info
SET bin_number='".$db->clean(substr($crypto->decrypt($client->cc_num),0,6))."'
,customer_vault_id_initial='".$db->clean($responses['customer_vault_id'])."'
WHERE id='".$db->clean($new_id)."'");
} else {
require_once($_SERVER['DOCUMENT_ROOT'].'/member/php/mailgun.php');
mailgun_send_message('jeremy@usbusinessfundingsolutions.com','NoReply@surfcrm.com','PCI Customer Vault Failed','<pre>'.print_r($responses,true).'</pre>',1,'PCI Customer Vault Failed','heinz57@gmail.com','','',0,array(),'',0);
}
//Add/Update the customer vault (Monthly Payments)
$client_res = $db->get_results("SELECT pi.*,r.email,r.phone_1
FROM lc2synment_lc.payment_info pi
LEFT JOIN lc2synment_lc.lc_reseller r ON r.id=pi.client_id
WHERE pi.id='".$db->clean($new_id)."'");
$client = $client_res[0];
$responses = array();
$ch = curl_init();
$c_url = "https://secure.networkmerchants.com/api/transact.php";
if($client->customer_vault_id==0) {
$query = "customer_vault=add_customer";
} else {
$query = "customer_vault=update_customer";
$query .= "&customer_vault_id=".$client->customer_vault_id;
}
$billing_address = $client->street_address;
$billing_city = $client->city;
$billing_state = $client->state;
$billing_zip = $client->zip;
$billing_phone = $client->phone_1;
$billing_email = $client->email;
if(!empty($client->name_as_appears)) {
$arr = explode(' ',$client->name_as_appears);
$billing_first = $arr[0];
$billing_last = str_replace($billing_first.' ','',$client->name_as_appears);
}
$query .= "&username=americanresourcemgmt";
$query .= "&password=USBFS2014&";
// Sales Information
if(strpos($crypto->decrypt($client->cc_num),'*')===false) {
$query .= "ccnumber=" . urlencode($crypto->decrypt($client->cc_num)) . "&";
$real_cc_num = $crypto->decrypt($client->cc_num);
$client->cc_num = $crypto->encrypt(substr($real_cc_num,0,6).'******'.substr($real_cc_num,-4));
}
$query .= "ccexp=" . urlencode($client->cc_exp_month . substr($client->cc_exp_year,-2)) . "&";
// Order Information
$query .= "ipaddress=" . urlencode($client->ip_address) . "&";
$query .= "ponumber=" . urlencode($client->phone_1) . "&";
// Billing Information
$query .= "firstname=" . urlencode($billing_first) . "&";
$query .= "lastname=" . urlencode($billing_last) . "&";
$query .= "company=" . urlencode('') . "&";
$query .= "address1=" . urlencode($billing_address) . "&";
$query .= "address2=" . urlencode('') . "&";
$query .= "city=" . urlencode($billing_city) . "&";
$query .= "state=" . urlencode($billing_state) . "&";
$query .= "zip=" . urlencode($billing_zip) . "&";
$query .= "country=" . urlencode('US') . "&";
$query .= "phone=" . urlencode($client->phone_1) . "&";
$query .= "fax=" . urlencode('') . "&";
$query .= "email=" . urlencode($client->email) . "&";
$query .= "website=" . urlencode('') . "&";
// Shipping Information
$query .= "shipping_firstname=" . urlencode($client->first) . "&";
$query .= "shipping_lastname=" . urlencode($client->last) . "&";
$query .= "shipping_company=" . urlencode('') . "&";
$query .= "shipping_address1=" . urlencode($client->address1) . "&";
$query .= "shipping_address2=" . urlencode('') . "&";
$query .= "shipping_city=" . urlencode($client->city) . "&";
$query .= "shipping_state=" . urlencode($client->state) . "&";
$query .= "shipping_zip=" . urlencode($client->zip) . "&";
$query .= "shipping_country=" . urlencode('US') . "&";
$query .= "shipping_email=" . urlencode($client->email);
//var_dump($query);
curl_setopt($ch, CURLOPT_URL, $c_url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_POST, 1);
$data = curl_exec($ch);
curl_close($ch);
unset($ch);
$data = explode("&",$data);
for($i=0;$i<count($data);$i++) {
$rdata = explode("=",$data[$i]);
$responses[$rdata[0]] = $rdata[1];
}
//var_dump($data);
//var_dump($responses);
if(!empty($responses['customer_vault_id'])) {
$db->query("UPDATE lc2synment_lc.payment_info
SET customer_vault_id_monthly='".$db->clean($responses['customer_vault_id'])."'
WHERE id='".$db->clean($new_id)."'");
}
$db->query("UPDATE lc2synment_lc.payment_info
SET cc_num='".$db->clean($_POST['cc_num_masked'])."'
,cc_cvv=''
WHERE id='".$db->clean($new_id)."'");
}
}
}
die();
}
$res = $db->get_results("SELECT r.id as rid,o.id as oid,r.first,r.last,r.address1,r.city,r.state,r.zip,r.phone_1,r.email,c.expires
FROM coaching_allocator.cc_info_request c
LEFT JOIN lc2synment_lc.orders o ON o.id=c.order_id
LEFT JOIN lc2synment_lc.lc_reseller r ON r.id=o.client_id
WHERE c.code='".$db->clean($_GET['c'])."'
AND c.expires >= NOW()
AND o.id IS NOT NULL");
?>
<!doctype html>
<html>
<head>
<title>PCI Compliant Credit Card Form</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
.container {
width:500px;
max-width:100%;
margin:0px auto;
text-align:center;
font-size:16px;
background:white;
}
.header {
text-align:center;
}
.header img {
width:100%;
}
.main_area {
text-align:left;
padding:10px;
}
.big_line {
margin:10px 0px;
}
.big_text {
font-size:28px;
color:#1e3891;
padding-bottom:10px;
}
.pci_logo {
float:right;
}
input[type=text],input[type=tel],select {
padding:10px 20px;
width:90%;
margin:0px auto;
font-size:20px;
}
#submit_button {
background:#dfedd6;
color:black;
border:1px solid black;
border-radius:5px;
cursor:pointer;
text-align:center;
padding:20px 0px;
font-size:20px;
width:90%;
}
</style>
<script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="/js/jquery.formatter.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input[name=cc_num]').formatter({
'pattern': '{{9999}}-{{9999}}-{{9999}}-{{9999}}',
'persistent': false
});
$('input[name=phone_1]').formatter({
'pattern': '({{999}}) {{999}}-{{9999}}',
'persistent': false
});
$('input[name=check_routing_num]').formatter({
'pattern': '{{999999999}}',
'persistent': false
});
});
function change_cc_type() {
if($('[name=cc_type]:checked').val()=='amex') {
$('input[name=cc_num]').formatter().resetPattern('{{9999}}-{{999999}}-{{99999}}');
$('input[name=cc_cvv]').formatter().resetPattern('{{9999}}');
$('input[name=cc_cvv]').css('width','46px');
$('input[name=cc_cvv]').css('padding','10px 13px');
$('input[name=cc_cvv]').attr('placeholder','3333');
$('input[name=cc_cvv]').attr('maxlength','4');
$('.cvv_info_not_amex').hide();
$('.cvv_info_amex').show();
} else {
$('input[name=cc_num]').formatter().resetPattern('{{9999}}-{{9999}}-{{9999}}-{{9999}}');
$('input[name=cc_cvv]').formatter().resetPattern('{{999}}');
$('input[name=cc_cvv]').css('width','32px');
$('input[name=cc_cvv]').css('padding','10px 20px');
$('input[name=cc_cvv]').attr('placeholder','333');
$('input[name=cc_cvv]').attr('maxlength','3');
$('.cvv_info_not_amex').show();
$('.cvv_info_amex').hide();
}
}
function change_payment_type(me) {
if($(me).val()=='credit_card') {
$('.checking_info').hide();
$('.credit_card_info').show();
$('.checking_info input').each(function() {
$(this).removeAttr('required');
});
$('input[name=cc_num]').attr('required','required');
$('select[name=cc_exp_month]').attr('required','required');
$('select[name=cc_exp_year]').attr('required','required');
$('input[name=cc_cvv]').attr('required','required');
$('input[name=cc_type]').each(function() {
$(this).attr('required','required');
});
} else {
$('.credit_card_info').hide();
$('.checking_info').show();
$('.credit_card_info input, .credit_card_info select').each(function() {
$(this).removeAttr('required');
});
$('input[name=check_routing_num]').attr('required','required');
$('input[name=check_account_num]').attr('required','required');
}
}
function save_cc_info(frm) {
var str="action=save_cc_info";
$(frm).find('input,select,textarea').each(function() {
if(this.type=='checkbox' || this.type=='radio') {
if($(this).is(':checked')) {
str += "&" + encodeURIComponent(this.name) + '=' + encodeURIComponent($(this).val());
}
} else {
str += "&" + encodeURIComponent(this.name) + '=' + encodeURIComponent($(this).val());
}
});
$.ajax({
url:"/member/pci_form.php",
cache: false,
type: "POST",
data: str,
success: function(results) {
if(results!='') {
alert(results);
} else {
$(frm)[0].outerHTML = '<p>Thank you for submitting your payment information.</p><div><button type="submit" id="submit_button" onclick="window.location.reload(); return false;">Add Another</button></div>';
}
},
error: function(jqXHR, textStatus, errorThrown) {
}
});
}
</script>
</head>
<body>
<div class="container">
<div class="header">
<img src="/images/logo_bigger.png" />
</div>
<div class="main_area">
<div class="big_line">
<div class="pci_logo"><img src="/images/pci_logo.png" /></div>
<div class="big_text">PCI Compliant Credit Card Form</div>
<div style="clear:both;"></div>
</div>
<?php if(empty($res)) { ?>
<p>This code has expired. Please contact your representative to send you a new one.</p>
<?php } else {
function convert_offset_to_timezone($offset,$dst) {
$tz = timezone_name_from_abbr(null, $offset * 3600, $dst);
return timezone_abbr_from_name($tz);
}
function timezone_abbr_from_name($timezone_name){
$dateTime = new DateTime();
$dateTime->setTimeZone(new DateTimeZone($timezone_name));
return $dateTime->format('T');
}
$expires_time = date('g:i a',strtotime($res[0]->expires)).' MST';
if(!empty($res[0]->zip)) {
$ares = $db->get_results("SELECT city,state,zip,IF(-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1,timezone+dst,timezone) as timezone, (-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1) as isDst FROM geo.zip_codes WHERE zip='{$res[0]->zip}'");
if(!empty($ares)) {
$arow = $ares[0];
$time_offset = $arow->timezone + 7;
$expires = strtotime($res[0]->expires) + ($time_offset*3600);
if($arow->state=='HI') {
$expires_time = date('g:i a',$expires).' HST';
} else {
$expires_time = date('g:i a',$expires).' '.convert_offset_to_timezone($arow->timezone,$arow->isDst);
}
} else {
$ares = $db->get_results("SELECT state_short,IF(-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1,timezone_offset,timezone_offset) as timezone, (-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1) as isDst FROM geo.states WHERE state_short='{$res[0]->state}'");
if(!empty($ares)) {
$arow = $ares[0];
$time_offset = $arow->timezone + 7;
$expires = strtotime($res[0]->expires) + ($time_offset*3600);
$expires_time = date('g:i a',$expires).' '.convert_offset_to_timezone($arow->timezone,$arow->isDst);
} else {
$expires_time = date('g:i a',strtotime($res[0]->expires)).' MST';
}
}
} else {
$area_code = substr($res[0]->phone_1,0,3);
$ares = $db->get_results("SELECT state,IF(-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1,timezone_offset,timezone_offset) as timezone, (-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1) as isDst FROM geo.area_codes WHERE area_code='{$area_code}'");
if(!empty($ares)) {
$arow = $ares[0];
$time_offset = $arow->timezone + 7;
$expires = strtotime($res[0]->expires) + ($time_offset*3600);
if($arow->state=='Hawaii') {
$expires_time = date('g:i a',$expires).' HST';
} else {
$expires_time = date('g:i a',$expires).' '.convert_offset_to_timezone($arow->timezone,$arow->isDst);
}
} else {
$ares = $db->get_results("SELECT state_short,IF(-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1,timezone_offset,timezone_offset) as timezone, (-8 - CAST(REPLACE(TIMEDIFF(NOW(), UTC_TIMESTAMP()), ':00:00', '') AS SIGNED)=1) as isDst FROM geo.states WHERE state_short='{$res[0]->state}'");
if(!empty($ares)) {
$arow = $ares[0];
$time_offset = $arow->timezone + 7;
$expires = strtotime($res[0]->expires) + ($time_offset*3600);
$expires_time = date('g:i a',$expires).' '.convert_offset_to_timezone($arow->timezone,$arow->isDst);
} else {
$expires_time = date('g:i a',strtotime($res[0]->expires)).' MST';
}
}
}
$is_dst = date('I')*1;
if($is_dst) {
$original_appointment_time = $expires;
$expires_time = str_replace('ST','DT',$expires_time);
if(!empty($arow)) {
if($arow->state=='AZ') {
$expires_time = $original_appointment_time;
}
}
}
?>
<div><i>Secure Payment Form Expires at <strong id="expire_timer"><?= $expires_time;?></strong></i></div>
<form onsubmit="save_cc_info(this); return false;">
<?php $is_there = $db->get_results("SELECT payment_type,cc_last_four,check_account_last_four
FROM lc2synment_lc.payment_info WHERE client_id='".$db->clean($res[0]->rid)."'");
if(!empty($is_there)) {
?><div><strong>You have the following payment types saved:</strong></div><?php
foreach($is_there as $i) {
echo ($i->payment_type=='credit_card') ? '<div style="padding-left:20px;">A Credit/Debit Card ending in '.$i->cc_last_four.'</div>' : '<div style="padding-left:20px;">A Checking Account ending in '.$i->check_account_last_four.'</div>';
}
}
?>
<input type="hidden" name="rid" value="<?= $res[0]->rid;?>" />
<input type="hidden" name="oid" value="<?= $res[0]->oid;?>" />
<input type="hidden" name="action" value="save_cc_info" />
<div class="big_line">
<div class="big_text">
Client Information
<a href="#" onclick="$('.real_client_address,.display_client_address').toggle(); return false;" style="font-size:12px;">Edit</a>
</div>
<div style="padding-left:30px;" class="display_client_address">
<div><?= $res[0]->first.' '.$res[0]->last;?></div>
<div><?= $res[0]->address1;?></div>
<div><?= $res[0]->city.', '.$res[0]->state.' '.$res[0]->zip;?></div>
<div><?= pretty_phone($res[0]->phone_1);?></div>
<div><?= $res[0]->email;?></div>
</div>
<div style="padding-left:30px;display:none;" class="real_client_address">
<div>
<label>Name on Card<br />
<input type="text" name="name_as_appears" value="<?= $res[0]->first.' '.$res[0]->last;?>" />
</label>
</div>
<div>
<label>Street Address<br />
<input type="text" name="street_address" value="<?= $res[0]->address1;?>" />
</label>
</div>
<div>
<label>City<br />
<input type="text" name="city" value="<?= $res[0]->city;?>" />
</label>
</div>
<div>
<label>State<br />
<input type="text" name="state" value="<?= $res[0]->state;?>" />
</label>
</div>
<div>
<label>Zip<br />
<input type="tel" name="zip" value="<?= $res[0]->zip;?>" />
</label>
</div>
<div>
<label>Phone<br />
<input type="tel" name="phone_1" value="<?= pretty_phone($res[0]->phone_1);?>" />
</label>
</div>
<div>
<label>Email<br />
<input type="text" name="email" value="<?= $res[0]->email;?>" />
</label>
</div>
</div>
</div>
<div class="big_line">
<div class="big_text">Choose One</div>
<div class="big_line">
<select name="payment_type" onchange="change_payment_type(this);">
<option value="credit_card">Credit/Debit Card</option>
<option value="check">Checking Account</option>
</select>
</div>
<div class="credit_cards credit_card_info">
<label><input type="radio" name="cc_type" value="visa" onclick="change_cc_type();" required style="vertical-align:middle;width:20px;height:20px;" /> <img src="/images/visa.png" style="vertical-align:middle;" /></label>
<label><input type="radio" name="cc_type" value="mast" onclick="change_cc_type();" required style="vertical-align:middle;width:20px;height:20px;" /> <img src="/images/mast.png" style="vertical-align:middle;" /></label>
<label><input type="radio" name="cc_type" value="disc" onclick="change_cc_type();" required style="vertical-align:middle;width:20px;height:20px;" /> <img src="/images/disc.png" style="vertical-align:middle;" /></label>
<label><input type="radio" name="cc_type" value="amex" onclick="change_cc_type();" required style="vertical-align:middle;width:20px;height:20px;" /> <img src="/images/amex.png" style="vertical-align:middle;" /></label>
</div>
</div>
<div class="big_line credit_card_info">
<input type="tel" id="cc_num" name="cc_num" placeholder="Credit Card Number" required />
</div>
<div class="big_line credit_card_info">
<div style="display:inline-block;vertical-align:middle;">
Expires
<select name="cc_exp_month" style="width:60px;padding:10px 0px;" required>
<option value="">MM</option>
<?php for($i=1;$i<=12;$i++) {?>
<option value="<?= str_pad($i,2,'0',STR_PAD_LEFT);?>"><?= str_pad($i,2,'0',STR_PAD_LEFT);?></option>
<?php } ?>
</select> /
<select name="cc_exp_year" style="width:80px;padding:10px 0px;" required>
<option value="">YYYY</option>
<?php $this_year = date('Y');
$end_year = $this_year*1 + 10;
for($i=$this_year;$i<=$end_year;$i++) { ?>
<option value="<?= $i;?>"><?= $i;?></option>
<?php } ?>
</select>
</div>
<div style="display:inline-block;vertical-align:middle;margin-left:10px;">
CVV <input type="tel" name="cc_cvv" placeholder="333" style="width:32px;" required />
</div>
<div class="cvv_info_not_amex" style="display:none;"><i style="font-size:14px;">* The CVV is a 3 digit number on the back of your card.</i></div>
<div class="cvv_info_amex" style="display:none;"><i style="font-size:14px;">* The CVV is a 4 digit number on the front of your card.</i></div>
</div>
<div class="big_line checking_info" style="display:none;">
<input type="tel" name="check_routing_num" placeholder="Routing Number" />
</div>
<div class="big_line checking_info" style="display:none;">
<input type="tel" name="check_account_num" placeholder="Account Number" />
</div>
<div class="big_line">
<center><button type="submit" id="submit_button">Submit</button></center>
</div>
</form>
<div class="big_line">
<center><img src="/images/ssl_logo.png" /></center>
</div>
<?php } ?>
</div>
</div>
</body>
</html>