| 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
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/php_header.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/phpCrypto.php');
$document_id = (isset($_REQUEST['id']) && preg_match('/^[0-9]+$/',trim($_REQUEST['id']))) ? trim($_REQUEST['id']) : 0;
$crypto = new phpCrypto();
if(!empty($_POST)) {
if(!empty($_SESSION['is_really_cs'])) {
header("Location: service-agreements.php");
exit(0);
}
$postdata = http_build_query(
array(
'id' => $document_id,
'contract_signature' => $_POST['contract_signature'],
'contract_date' => $_POST['contract_date']
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$html = file_get_contents('https://usbusinessfundingsolutions.com/member/php/sign_contract.php', false, $context);
$enc_html = $crypto->encrypt($html);
$db->query("UPDATE lc2synment_lc.document SET htmlsigned='".$db->clean($enc_html)."',datesigned=NOW() WHERE id='{$document_id}'");
$res = $db->get_results("SELECT a.* FROM lc2synment_lc.document d LEFT JOIN coaching_allocator.leads a ON d.client_id=a.synergy_client_id WHERE d.id='{$document_id}'");
if(!empty($res)) {
if($res[0]->id!='') {
$db->query("INSERT INTO coaching_allocator.leadlog (leadid,marketer,codetype,code,codedate)
VALUES (
'".$db->clean($res[0]->id)."',
'".$db->clean($res[0]->closer)."',
'closer_status',
'SOLD',
NOW()
)");
$db->query("UPDATE coaching_allocator.leads SET marketer_status='SOLD',marketer_statusdate=NOW(),closer_status='SOLD',closer=IF(closer='',marketer,closer),closer_statusdate=NOW() WHERE id='".$db->clean($res[0]->id)."'");
}
}
//die('<script type="text/javascript">window.top.location.reload();</script>');
header("Location: service-agreements.php");
}
$res = $db->get_results("SELECT * FROM lc2synment_lc.document WHERE id='{$document_id}'");
$row = $res[0];
if($row->datesigned=='2000-01-01 00:00:00' || $row->datesigned=='0000-00-00 00:00:00') {
/*$new_html = "<div class=\"container\" style=\"margin-top: 30px;\">
<div class=\"background_top\">
<div class=\"background_top_left\"></div>
<div class=\"background_top_center\"></div>
<div class=\"background_top_right\"></div>
<div class=\"clear\"></div>
</div>
<div class=\"background_center\">
<div class=\"background_left\"></div>
<div class=\"content\">
<div id=\"ElectronicSignatureDisclosure\" class=\"businessplan_olc c_funding f_funding cancel\">
<img src=\"/images/contracts/h_electronic_signature_disclosure.jpg\" id=\"electronic_signature_disclosure_header\" alt=\"Electronic Signature Disclosure\">
<p>IN WITNESS WHEREOF the undersigned has executed this Agreement as of ".(date('D, j M Y')).". You agree that your digital signature is equivalent to a handwritten signature as provide in The Federal E-Sign Act. By clicking the 'I AGREE' button below, you agree to use electronic communications, electronic records and electronic signature rather than using paper documents for the forms provided on this site. I understand that electronic signature, just like my signing a piece of paper, are legally binding in the United States and in other countries. I further agree not to electronically sign any document without first reading it and ensuring I have accurately filled out the document to the best of my knowledge, This agreement becomes effective upon the signature of both parties below.</p>
<p>You may print a copy of this document using your own printer. Printed copies are not considered to be legal originals, but our system maintains a legal copy for you within the account section of the Online Learning Center.</p>
<div style=\"margin: 0px 0px 20px 150px;\">
<p>Please type your Digital Signature below:</p><form id=\"DocumentSignForm\" method=\"post\" action=\"view-contract.php?id=".$document_id."\" accept-charset=\"utf-8\"><div style=\"display:none;\"></div><input name=\"contract_signature\" type=\"text\" title=\"You must enter your full name as your signature to sign this contract.\" style=\"width:50%;margin-bottom:5px;\" id=\"ContractExtraSignature\"><input type=\"hidden\" name=\"contract_date\" value=\"".(date('D, j M Y'))."\" id=\"ContractExtraSignDate\"><div class=\"submit\"><input type=\"submit\" value=\"I AGREE\"></div></form> </div>
</div>
</div>
<div class=\"background_right\"></div>
<div class=\"clear\"></div>
</div>
<div class=\"background_bottom\">
<div class=\"background_bottom_left\"></div>
<div class=\"background_bottom_center\"></div>
<div class=\"background_bottom_right\"></div>
<div class=\"clear\"></div>
</div>
</div>";*/
if($row->doc_version==4) {
$new_html = file_get_contents('https://surfcrm.com/bin/includes/contracts/electronic_signature_disclosure_v4.php?id='.$document_id);
} elseif($row->doc_version==2) {
$new_html = file_get_contents('https://surfcrm.com/bin/includes/contracts/electronic_signature_disclosure_v2.php?id='.$document_id);
} else {
$new_html = file_get_contents('https://surfcrm.com/bin/includes/contracts/electronic_signature_disclosure.php?id='.$document_id);
}
if($row->doc_type=='mock') {
$new_html .= "<style type='text/css' media='all'>
.content, .size {
position: relative;
}
#ClientInfo:after {
content:'SAMPLE';
text-align:center;
margin-left: 30px;
color:rgba(0,0,0,.3);
font-size:160px;
position:absolute;
top:63px;
}
</style>";
}
$html = $crypto->decrypt($row->html);
$html = str_replace('<title>Synergy Enrollment Agreement</title>','<title>Enrollment Agreement</title>',$html);
$new_html = str_replace('margin: 0px 0px 20px 150px;','text-align:center;',$new_html);
$new_html = str_replace('margin: 5px 0px 5px 75px;','',$new_html);
$exploded_html = explode('</body',$html);
echo $exploded_html[0].$new_html.'</body></html>';
} else {
$html = $crypto->decrypt($row->htmlsigned);
if(empty($html) && !empty($row->htmlsigned)) {
if(strtotime($row->datecreated) >= strtotime('2020-09-08 14:32:00')) {
$new_html = file_get_contents('https://surfcrm.com/bin/includes/contracts/electronic_signature_disclosure_v4.php?id='.$_REQUEST['id']);
} else {
$new_html = file_get_contents('https://surfcrm.com/bin/includes/contracts/electronic_signature_disclosure_v2.php?id='.$_REQUEST['id']);
}
$html = $crypto->decrypt($row->html);
$exploded_html = explode('</body',$html);
$html = $exploded_html[0].$new_html.'</body></html>';
}
$html = str_replace('margin: 0px 0px 20px 150px;','text-align:center;',$html);
$html = str_replace('margin: 5px 0px 5px 75px;','',$html);
$html = str_replace('<input type="checkbox"','<input type="checkbox" checked',$html);
if($row->doc_type=='mock') {
$doc = explode('</body>',$html);
$doc[0] .= "<style type='text/css' media='all'>
.content, .size {
position: relative;
}
#ClientInfo:after {
content:'SAMPLE';
text-align:center;
margin-left: 30px;
color:rgba(0,0,0,.3);
font-size:160px;
position:absolute;
top:63px;
}
</style>";
$html = $doc[0].'</body></html>';
}
if($row->void==1) {
$doc = explode('</body>',$html);
$doc[0] .= "<style type='text/css' media='all'>
.content, .size {
position: relative;
}
#ClientInfo:after {
content:'VOID';
text-align:center;
margin-left: 30px;
color:rgba(0,0,0,.3);
font-size:250px;
position:absolute;
top:-10px;
}
</style>";
$html = $doc[0].'</body></html>';
}
$html = str_replace('<title>Synergy Enrollment Agreement</title>','<title>Enrollment Agreement</title>',$html);
echo $html;
}
if(!empty($_REQUEST['print'])) { ?>
<script type="text/javascript">
window.print();
</script>
<?php } ?>