| 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/governmentgrants.us/vx/usa/givesback/ |
Upload File : |
<?php
session_start();
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/ua.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/func.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mysql.php');
track_member_action('Page Visit','Gives Back');
$user = $_SESSION['user'];
if(!empty($_POST['action'])) {
switch($_POST['action']) {
case 'confirm_step':
$is_there = $db->get_results("SELECT id FROM grdb.givesback_steps_done
WHERE site_code='".$db->clean($siteCode)."'
AND client_id='".$db->clean($user)."'
AND step_done='".$db->clean($_POST['name'])."'");
if(empty($is_there)) {
$db->query("INSERT INTO grdb.givesback_steps_done
(
site_code
,client_id
,step_done
,ts
) VALUES (
'".$db->clean($siteCode)."'
,'".$db->clean($user)."'
,'".$db->clean($_POST['name'])."'
,NOW()
)");
}
die();
break;
case 'edit_name':
$db->query("UPDATE lc2{$siteCode}_lc.lc_reseller
SET first='".$db->clean($_POST['first'])."'
,last='".$db->clean($_POST['last'])."'
WHERE id='".$db->clean($user)."'");
break;
case 'edit_email':
$db->query("UPDATE lc2{$siteCode}_lc.lc_reseller
SET email='".$db->clean($_POST['email'])."'
WHERE id='".$db->clean($user)."'");
break;
case 'edit_phone':
$db->query("UPDATE lc2{$siteCode}_lc.lc_reseller
SET phone_1='".$db->clean(preg_replace('/[^0-9]/','',$_POST['phone']))."'
WHERE id='".$db->clean($user)."'");
break;
case 'edit_address':
$db->query("UPDATE lc2{$siteCode}_lc.lc_reseller
SET address1='".$db->clean($_POST['address'])."'
,city='".$db->clean($_POST['city'])."'
,state='".$db->clean($_POST['state'])."'
,zip='".$db->clean($_POST['zip'])."'
WHERE id='".$db->clean($user)."'");
break;
}
header("Location: /vx/usa/givesback/");
exit(0);
}
$client_info = (object) array();
$confirmed = array();
if(!empty($user)) {
//Check if they won
$res = $db->get_results("SELECT id FROM grdb.givesback_winners
WHERE site_code='".$db->clean($siteCode)."'
AND client_id='".$db->clean($user)."'");
if(!empty($res)) {
//They won, redirect to winner page
header("Location: winner.php");
exit(0);
}
$res = $db->get_results("SELECT step_done,ts
FROM grdb.givesback_steps_done
WHERE site_code='".$db->clean($siteCode)."'
AND client_id='".$db->clean($user)."'");
foreach($res as $r) {
$confirmed[$r->step_done] = date('M d, Y',strtotime($r->ts));
}
$already_entered = false;
//check if all steps are done, and put them in the givesback entered if so
$res = $db->get_results("SELECT ts FROM grdb.givesback_entered
WHERE site_code='".$db->clean($siteCode)."'
AND client_id='".$db->clean($user)."'");
if(empty($res)) {
if(count($confirmed)==5) {
$cat_id = 3; //Default to Personal
$date_ordered = '0000-00-00 00:00:00';
//They have all the steps done, enter them
$res = $db->get_results("SELECT p.profile_category_id,r.date_ordered
FROM lc2{$siteCode}_lc.lc_reseller r
LEFT JOIN lc2{$siteCode}_lc.lc_leads l ON l.customerID=r.id
LEFT JOIN lc2{$siteCode}_lc.lead_profile p ON p.lead_id=l.id
WHERE r.id='".$db->clean($user)."'");
if(!empty($res)) {
if(!empty($res[0]->profile_category_id)) {
$cat_id = $res[0]->profile_category_id;
}
$date_ordered = $res[0]->date_ordered;
}
$db->query("INSERT INTO grdb.givesback_entered
(
site_code
,client_id
,category_id
,date_ordered
,still_active
,ts
) VALUES (
'".$db->clean($siteCode)."'
,'".$db->clean($user)."'
,'".$db->clean($cat_id)."'
,'".$db->clean($date_ordered)."'
,1
,NOW()
)");
}
} else {
$already_entered = date('M d, Y',strtotime($res[0]->ts));
}
$res = $db->get_results("SELECT first,last,email,phone_1,address1,city,state,zip
FROM lc2{$siteCode}_lc.lc_reseller
WHERE id='".$db->clean($user)."'");
if(!empty($res)) {
$client_info = $res[0];
}
if(empty($_SESSION['visited_givesback'])) {
$_SESSION['visited_givesback'] = 1;
$db->query("INSERT IGNORE INTO grdb.givesback_page_has_visited
(
site_code
,client_id
,first_visit
) VALUES (
'".$db->clean($siteCode)."'
,'".$db->clean($user)."'
,NOW()
)");
}
}
ob_start();
?>
<script type="text/javascript">
function givesback_confirm_step(nm) {
var querystring = 'action=confirm_step&name=' + encodeURIComponent(nm);
$.ajax({
url:"/vx/usa/givesback/index.php",
cache: false,
type: "POST",
data: querystring,
success: function(results) {
window.location.reload(false);
}
});
}
</script>
<?php
$total_amount = 0;
$tres = $db->get_results("SELECT SUM(amount) as total_amount
FROM grdb.givesback_winners
WHERE money_sent<>'0000-00-00 00:00:00'");
$total_amount = $tres[0]->total_amount;
$next_date = date('M d, Y',strtotime('next monday'));
?>
<!-- ===== Modern Givesback Main Section (drop into your center column) ===== -->
<main class="givesback-main">
<!-- Program Card -->
<section class="givesback-card">
<div class="givesback-header">
<img src="givesback_black.png" alt="USA Givesback" class="givesback-logo">
<div class="givesback-total"><i>Total Awarded: <strong>$<?= number_format($total_amount);?></strong></i></div>
<div class="givesback-next-date"><i>Next Givesback Award Date:<br /><strong><?= $next_date;?></strong></i></div>
</div>
<div class="givesback-body">
<p>In our ongoing commitment to help you achieve your funding goals and to express our gratitude to our clients, we’re excited to introduce the <strong>USA Givesback</strong> Cash Award Program. Each month, a select number of members will be chosen at random to receive cash awards. Award amounts will vary, and individuals, organizations, and businesses are all eligible to participate.</p>
<p>Winners will be notified by both email and text, and their names will also be featured on the <strong>Givesback Page</strong> of our website. Restrictions apply.</p>
<h4>How to Enter:</h4>
<ol>
<li>Search our grant application database and select your <strong>3 favorite grants</strong>.</li>
<li>Click the heart icon in the bottom right corner of each grant page to mark them as favorites. As long as you have 3 funding sources marked as favorites and your account is active, you’ll be eligible for the drawing.</li>
<li>Verify your name, email address, mobile phone number, and mailing address so we can contact you if you’re selected.</li>
</ol>
<p class="givesback-thankyou">Thank you for being a valued USA Givesback client—we’re proud to support you in reaching your funding goals!</p>
</div>
</section>
<!-- Status Card -->
<section class="givesback-status-card">
<h3>Your "Givesback" Status</h3>
<div>Confirm your information is correct</div>
<ul>
<li>
<div class="do_flex">
<div>
<span class="checkmark"><?= (!empty($confirmed['name'])) ? '✔' : '';?></span>
</div>
<div>
<strong>Name:</strong>
</div>
<?php if(!empty($confirmed['name'])) { ?>
<div>
<i style="display:inline-block;padding-left:5px;padding-right:5px;"><?= $confirmed['name'];?></i>
</div>
<?php } ?>
<div>
<?= $client_info->first;?> <?= $client_info->last;?>
</div>
<?php if(empty($confirmed['name'])) { ?>
<div>
<button onclick="$('#name_edit').toggle(); return false;">Edit</div>
<button onclick="givesback_confirm_step('name'); return false;" class="confirm_info_button">Confirm</button>
</div>
<?php } ?>
</div>
<div id="name_edit" style="display:none;">
<form method="post" action="index.php">
<input type="hidden" name="action" value="edit_name" />
<div style="margin:2px 0px;"><input type="text" name="first" value="<?= $client_info->first;?>" placeholder="First Name" /></div>
<div style="margin:2px 0px;"><input type="text" name="last" value="<?= $client_info->last;?>" placeholder="Last Name" /></div>
<div style="margin:2px 0px;"><input type="submit" name="submit" value="Save" /></div>
</form>
</div>
</li>
<li>
<div class="do_flex">
<div>
<span class="checkmark"><?= (!empty($confirmed['email'])) ? '✔' : '';?></span>
</div>
<div>
<strong>Email:</strong>
</div>
<?php if(!empty($confirmed['email'])) { ?>
<div>
<i style="display:inline-block;padding-left:5px;padding-right:5px;"><?= $confirmed['email'];?></i>
</div>
<?php } ?>
<div>
<?= $client_info->email;?>
</div>
<?php if(empty($confirmed['email'])) { ?>
<div>
<button onclick="$('#email_edit').toggle(); return false;">Edit</button>
<button onclick="givesback_confirm_step('email'); return false;" class="confirm_info_button">Confirm</button>
</div>
<?php } ?>
</div>
<div id="email_edit" style="display:none;">
<form method="post" action="index.php">
<input type="hidden" name="action" value="edit_email" />
<div style="margin:2px 0px;"><input type="text" name="email" value="<?= $client_info->email;?>" placeholder="Email" /></div>
<div style="margin:2px 0px;"><input type="submit" name="submit" value="Save" /></div>
</form>
</div>
</li>
<li>
<div class="do_flex">
<div>
<span class="checkmark"><?= (!empty($confirmed['phone'])) ? '✔' : '';?></span>
</div>
<div>
<strong>Mobile:</strong>
</div>
<?php if(!empty($confirmed['phone'])) { ?>
<div>
<i style="display:inline-block;padding-left:5px;padding-right:5px;"><?= $confirmed['phone'];?></i>
</div>
<?php } ?>
<div>
<?= phone_number($client_info->phone_1);?>
</div>
<?php if(empty($confirmed['phone'])) { ?>
<div>
<button onclick="$('#phone_edit').toggle(); return false;">Edit</button>
<button onclick="givesback_confirm_step('phone'); return false;" class="confirm_info_button">Confirm</button>
</div>
<?php } ?>
</div>
<div id="phone_edit" style="display:none;">
<form method="post" action="index.php">
<input type="hidden" name="action" value="phone_email" />
<div style="margin:2px 0px;"><input type="text" name="phone" value="<?= phone_number($client_info->phone_1);?>" placeholder="Mobile Phone" /></div>
<div style="margin:2px 0px;"><input type="submit" name="submit" value="Save" /></div>
</form>
</div>
</li>
<li>
<div class="do_flex">
<div>
<span class="checkmark"><?= (!empty($confirmed['address'])) ? '✔' : '';?></span>
</div>
<div>
<strong>Address:</strong>
</div>
<?php if(!empty($confirmed['address'])) { ?>
<div>
<i style="display:inline-block;padding-left:5px;padding-right:5px;"><?= $confirmed['address'];?></i>
</div>
<?php } ?>
<div>
<?= $client_info->address1.' '.$client_info->city.', '.$client_info->state.' '.$client_info->zip;?>
</div>
<?php if(empty($confirmed['address'])) { ?>
<div>
<button onclick="$('#address_edit').toggle(); return false;">Edit</button>
<button onclick="givesback_confirm_step('address'); return false;" class="confirm_info_button">Confirm</button>
</div>
<?php } ?>
</div>
<div id="address_edit" style="display:none;">
<form method="post" action="index.php">
<input type="hidden" name="action" value="edit_address" />
<div style="margin:2px 0px;"><input type="text" name="address" value="<?= $client_info->address1;?>" placeholder="Street Address" /></div>
<div style="margin:2px 0px;"><input type="text" name="city" value="<?= $client_info->city;?>" placeholder="City" /></div>
<div style="margin:2px 0px;"><input type="text" name="state" value="<?= $client_info->state;?>" placeholder="State" /></div>
<div style="margin:2px 0px;"><input type="text" name="zip" value="<?= $client_info->zip;?>" placeholder="Zip" /></div>
<div style="margin:2px 0px;"><input type="submit" name="submit" value="Save" /></div>
</form>
</div>
</li>
<li>
<div class="do_flex">
<div>
<span class="checkmark"><?= (!empty($confirmed['favorites'])) ? '✔' : '';?></span>
</div>
<div>
<strong>Favorited 3 Grants:</strong>
</div>
<div>
<?= $confirmed['favorites'];?>
</div>
</div>
</li>
<li>
<div class="do_flex">
<div>
<span class="checkmark"><?= (!empty($already_entered)) ? '✔' : '';?></span>
</div>
<div>
<strong>Entered into the "Givesback" Program:</strong>
</div>
<div>
<?= $already_entered;?>
</div>
</div>
</li>
</ul>
</section>
<center><div><img src="past_award_recipients.png" /></div></center>
<!-- Testimonials Grid -->
<section class="givesback-testimonials">
<div id="gb-grid" class="gb-grid" aria-live="polite">
<?php $tres = $db->get_results("SELECT money_sent,amount,how_use_money,site_code,client_id,picture_location,IF(picture_location='',0,1) as has_picture FROM grdb.givesback_winners WHERE published=1 AND money_sent<>'0000-00-00 00:00:00' ORDER BY has_picture DESC,money_sent DESC");
foreach($tres as $tr) {
$tcres = $db->get_results("SELECT first,last FROM lc2{$tr->site_code}_lc.lc_reseller WHERE id='".$db->clean($tr->client_id)."'");
if(!empty($tcres)) {
?>
<article class="gb-card">
<?php if(!empty($tr->picture_location)) { ?>
<div class="gb-media">
<img loading="lazy" decoding="async" alt="<?= $tr->picture_location;?>" src="https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=<?= urlencode($tr->picture_location);?>" onerror="$(this).remove();" />
</div>
<?php } ?>
<div class="gb-card-body">
<div class="gb-name-date">
<span class="name"><?= ucwords(strtolower($tcres[0]->first)).' '.substr(ucwords(strtolower($tcres[0]->last)),0,1);?></span>
<span class="date">awarded on <?= date('F j, Y',strtotime($tr->money_sent));?></span>
</div>
<div class="gb-quote"><?= $tr->how_use_money;?></div>
</div>
</article>
<?php
}
}
?>
</div>
</section>
</main>
<!-- ===== Styles ===== -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
.givesback-main { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; padding: 24px; background-color: #f9fafb; }
.givesback-card, .givesback-status-card { max-width: 900px; margin: 0 auto 40px; background: #fff; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.06); overflow: hidden; }
.givesback-header { text-align: center; padding: 20px; background-color: #f3f4f6; }
.givesback-logo { width: 100%; max-width: 300px; margin-bottom: 10px; }
.givesback-total { font-size: 16px; color: #374151; }
.givesback-next-date { font-size: 16px; color: #b91c1c; margin-top: 4px; font-style: italic; }
.givesback-body { padding: 20px 24px; line-height: 1.6; color: #111827; }
.givesback-body h4 { margin-top: 20px; font-size: 18px; font-weight: 600; }
.givesback-body ol { padding-left: 20px; }
.givesback-body ol li { margin-bottom: 10px; }
.givesback-thankyou { margin-top: 20px; font-weight: 500; }
.givesback-status-card { padding: 20px 24px; }
.givesback-status-card h3 { margin-bottom: 12px; font-weight: 600; color: #111827; }
.givesback-status-card ul { list-style: none; padding: 0; margin: 0; }
.givesback-status-card .do_flex { padding: 8px 0; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; }
.checkmark { color: #10b981; font-weight: bold; margin-right: 8px; }
/* Testimonials grid */
.gb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.gb-card { border-radius: 16px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.06); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.gb-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.gb-media { background: #f3f4f6; aspect-ratio: 4/3; overflow: hidden; }
.gb-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gb-card:hover .gb-media img { transform: scale(1.03); }
.gb-card-body { padding: 16px 18px 20px; }
.gb-name-date { font-size: 16px; color: #111827; }
.gb-name-date .name { font-weight: 700; font-size: 18px; }
.gb-name-date .date { font-style: italic; color: #6b7280; margin-left: 4px; }
.gb-quote { margin-top: 8px; color: #374151; font-style: italic; font-size: 15px; line-height: 1.6; }
.gb-legacy-hidden { display: none !important; }
</style>
<?php
$body = ob_get_clean();
$title = "Gives Back : ".$_SESSION['site_name'];
include($_SERVER['DOCUMENT_ROOT'].'/vx/usa/layout/non_angular_layout.php');
?>