| 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/pcisecureform.com/lcapi/ |
Upload File : |
<?php
$return = array();
ob_start();
if(!empty($_POST['site_code']) && !empty($_POST['client_id'])) {
require_once($_SERVER['DOCUMENT_ROOT'].'/php/db_config_lc_user.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/php/mailgun.php');
$db = connect_lc2user_new('lc2'.$_POST['site_code'].'_lc');
require_once($_SERVER['DOCUMENT_ROOT'].'/lcapi/inc/Crypto.class.php');
$crypto = new phpCrypto();
$res = $db->get_results("SELECT `user`,`email`,`first`,`password` FROM lc_reseller WHERE id='".$db->clean($_POST['client_id'])."'");
$db->debug();
if(empty($res)) {
$return['error'] = 'There was a problem. Please contact customer support. 1';
} else {
$db->query("UPDATE lc_reseller
SET
active=1
,cardInvalid=0
,cc_failed_message=''
,date_inactive='0000-00-00'
,next_bill_date='".date('Y-m-d',strtotime('+30 day'))."'
,date_cancelled='0000-00-00 00:00:00'
WHERE id='".$db->clean($_POST['client_id'])."'
");
$db->debug();
$db->query("UPDATE lc_clients_subscriptions
SET
active=1
,next_bill_date='".date('Y-m-d',strtotime('+30 day'))."'
,amount='9.97'
WHERE
reseller_id='".$db->clean($_POST['client_id'])."'
AND subscription_id=2");
$db->debug();
$tres = $db->get_results("SELECT * FROM lc_clients_subscriptions WHERE reseller_id='".$db->clean($_POST['client_id'])."' AND subscription_id='3'");
if(empty($tres)) {
$db->query("INSERT INTO lc_clients_subscriptions
(
subscription_id
,reseller_id
,amount
,next_bill_date
,bill_time_of_day
,order_date
,order_datetime
,cancel_date
,cancel_datetime
,terms
,term_length
,rebills
,declines
,active
,source
,rep
) VALUES (
'3'
,'".$db->clean($_POST['client_id'])."'
,'0.00'
,'".date('Y-m-d',strtotime('+30 day'))."'
,'morning'
,CURDATE()
,NOW()
,'0000-00-00'
,'0000-00-00 00:00:00'
,'4199999999'
,'30'
,'0'
,'0'
,'1'
,'fee_reduced_email'
,''
)");
} else {
$db->query("UPDATE lc_clients_subscriptions
SET
active=1
,next_bill_date='".date('Y-m-d',strtotime('+30 day'))."'
,amount='0'
WHERE
reseller_id='".$db->clean($_POST['client_id'])."'
AND subscription_id=3");
}
$db->debug();
$db->query("UPDATE lc2admin.cancel_reactivations_fee_reduced
SET
reactivated_account=NOW()
WHERE id='".$db->clean($_POST['rid'])."'");
$db->debug();
$return['username'] = $res[0]->user;
$return['password'] = $res[0]->password;
$sres = $db->get_results("SELECT * FROM lc2admin.site WHERE site_code='".$db->clean($_POST['site_code'])."'");
$site_info = $sres[0];
$next_bill_date = date('m/d/Y',strtotime('+30 day'));
$phone = substr($site_info->phone,0,3).'-'.substr($site_info->phone,3,3).'-'.substr($site_info->phone,6);
$body = "{$res[0]->first},
This email confirms your monthly rate reduction to $9.97 on {$site_info->site_name}. You will receive access to 1000's of new grant applications, access to 2 live teleconferences each week with a grant expert, and grant alerts in your inbox.
Your next bill date will be on {$next_bill_date}. Remember, if you don't get accepted for a grant, you will be refunded immediately. Just provide us with the application you applied for and the response letter from the grantor.
If you have any questions, please use our contact us form located at {$site_info->site_domain}/contact.php
Best Wishes,
{$site_info->site_name}
{$site_info->mailing_address}
Phone: {$phone}
Email: {$site_info->refund_email}
Website: {$site_info->site_domain}
Contact Us Form: {$site_info->site_domain}/contact.php";
//mail($res[0]->email,'Monthly Rate Reduction',$body,"From:{$site_info->refund_email}\r\n");
mailgun_send_message($res[0]->email,$site_info->refund_email,'Monthly Rate Reduction',nl2br($body),1,'Monthly Rate Reduction','','',$_POST['site_code'],$_POST['client_id'],array());
$db->query("INSERT INTO surfcrm.notes
(
timeclock_id
,site_code
,client_type
,client_id
,`date`
,type
,note
,username
,first_name
,last_name
,active
) VALUES (
'0'
,'".$db->clean($_POST['site_code'])."'
,'clients'
,'".$db->clean($_POST['client_id'])."'
,NOW()
,'System Note'
,'Monthly Fee Reduced from {$_POST['ip_address']}<br />".$db->clean($body)."'
,'SurfCRM'
,'Surf'
,'CRM'
,'1'
)");
}
} else {
$return['error'] = 'There was a problem. Please contact customer support. 2';
}
$debug = ob_get_clean();
//$return['debug'] = $debug();
die(json_encode($return));
?>