| 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':
if($_POST['name']=='name') {
$fields_to_update = array('name','email','phone','address');
foreach($fields_to_update as $field) {
$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($field)."'");
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($field)."'
,NOW()
)");
}
}
}
die();
break;
case 'update_contact_info':
$db->query("UPDATE lc2{$siteCode}_lc.lc_reseller
SET first='".$db->clean($_POST['first_name'])."'
,last='".$db->clean($_POST['last_name'])."'
,address1='".$db->clean($_POST['street_address'])."'
,city='".$db->clean($_POST['city'])."'
,state='".$db->clean($_POST['state'])."'
,zip='".$db->clean($_POST['zip'])."'
,email='".$db->clean($_POST['email'])."'
,phone_1='".$db->clean(preg_replace('/[^0-9]/','',$_POST['phone']))."'
WHERE id='".$db->clean($user)."'");
break;
case 'refresh_favorited_list':
$favorited_list = array();
$fres = $db->get_results("SELECT g.grants_id,g.name
FROM grdb.grd_usa_saved_grants gs
LEFT JOIN grdb.grd_grants g ON g.grants_id=gs.grants_id
WHERE gs.site_code='".$db->clean($siteCode)."'
AND gs.client_id='".$db->clean($user)."'
LIMIT 3");
if(!empty($fres)) {
foreach($fres as $fr) {
$favorited_list[] = $fr->name;
}
}
$return = array();
$res = $db->get_results("SELECT ts
FROM grdb.givesback_steps_done
WHERE site_code='".$db->clean($siteCode)."'
AND client_id='".$db->clean($user)."'
AND step_done='favorites'");
if(!empty($res)) {
$return['date_favorited'] = date('M d, Y',strtotime($res[0]->ts));
//Check to see if they need to be entered
$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)) {
$confirmed = array();
$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));
}
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()
)");
}
}
}
$return['favorites'] = $favorited_list;
echo json_encode($return);
die();
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()
)");
}
}
$total_amount = 0;
$total_winners = 0;
$tres = $db->get_results("SELECT COUNT(*) as winners,SUM(amount) as total_amount
FROM grdb.givesback_winners
WHERE money_sent<>'0000-00-00 00:00:00'");
$total_amount = $tres[0]->total_amount;
$total_winners = $tres[0]->winners;
$next_date = date('M d',strtotime('next monday'));
$favorited_list = array();
$favorited_list_ids = array();
$fres = $db->get_results("SELECT g.grants_id,g.name
FROM grdb.grd_usa_saved_grants gs
LEFT JOIN grdb.grd_grants g ON g.grants_id=gs.grants_id
WHERE gs.site_code='".$db->clean($siteCode)."'
AND gs.client_id='".$db->clean($user)."'
LIMIT 3");
if(!empty($fres)) {
foreach($fres as $fr) {
$favorited_list[] = $fr->name;
$favorited_list_ids[] = $fr->grants_id;
}
}
$givesback_next_awards = array();
$res = $db->get_results("SELECT winner_date,winner_amount
FROM grdb.givesback_new_winners
WHERE 1 ORDER BY winner_date ASC");
if(!empty($res)) {
foreach($res as $r) {
$givesback_next_awards[] = $r;
}
}
$most_favorited = $db->get_results("SELECT g.grants_id,g.name,g.url,g.deadline,g.amount,g.brief_summary,g.favorited,gt.name as type_name
FROM grdb.grd_grants g
LEFT JOIN grdb.grd_types gt ON gt.types_id=g.types_id
WHERE g.deadline='0000-00-00'
AND g.bad_url=0
UNION ALL SELECT g.grants_id,g.name,g.url,g.deadline,g.amount,g.brief_summary,g.favorited,gt.name as type_name
FROM grdb.grd_grants g
LEFT JOIN grdb.grd_types gt ON gt.types_id=g.types_id
WHERE g.deadline >= CURDATE()
AND g.bad_url=0
ORDER BY favorited DESC
LIMIT 60");
ob_start();
?>
<link rel="stylesheet" href="styles.css?ts=2025_09_11">
<div class="min-h-screen bg-muted-30">
<main class="flex-1 transition-all duration-300">
<div class="max-w-6xl mx-auto p-6 space-y-6">
<!-- Countdown Timer -->
<div class="countdown-timer">
<div class="bg-gradient-to-r from-red-500 to-red-600 text-white py-3 px-4 text-center animate-fade-in">
<div class="max-w-6xl mx-auto flex items-center justify-center gap-4 flex-wrap">
<div class="flex items-center gap-2">
<i class="fas fa-clock h-5 w-5 animate-pulse"></i>
<span class="font-semibold">Next Weekly Award in:</span>
</div>
<div class="flex items-center gap-1 text-sm sm:text-base">
<div class="bg-white/20 rounded px-2 py-1 min-w-3rem text-center">
<div class="font-bold text-lg leading-tight" id="days">0</div>
<div class="text-xs uppercase tracking-wide opacity-90">Days</div>
</div>
<span class="text-xl font-bold mx-1">:</span>
<div class="bg-white/20 rounded px-2 py-1 min-w-3rem text-center">
<div class="font-bold text-lg leading-tight" id="hours">0</div>
<div class="text-xs uppercase tracking-wide opacity-90">Hours</div>
</div>
<span class="text-xl font-bold mx-1">:</span>
<div class="bg-white/20 rounded px-2 py-1 min-w-3rem text-center">
<div class="font-bold text-lg leading-tight" id="minutes">0</div>
<div class="text-xs uppercase tracking-wide opacity-90">Min</div>
</div>
<span class="text-xl font-bold mx-1">:</span>
<div class="bg-white/20 rounded px-2 py-1 min-w-3rem text-center">
<div class="font-bold text-lg leading-tight animate-pulse" id="seconds">0</div>
<div class="text-xs uppercase tracking-wide opacity-90">Sec</div>
</div>
</div>
<span class="text-sm font-medium bg-white/20 rounded-full px-3 py-1">
🎯 Don't miss out!
</span>
</div>
</div>
</div>
<!-- Hero Section -->
<div class="hero-section">
<div class="card shadow-xl border-0 bg-gradient-to-br from-primary-5 via-background to-secondary-5 overflow-hidden">
<div class="p-0">
<div class="grid lg-grid-cols-2 gap-0">
<!-- Left side - Content -->
<div class="p-8 lg:p-12 flex flex-col justify-center">
<div class="space-y-6">
<div class="space-y-3">
<div class="badge bg-green-100 text-green-800 border-green-200 text-sm px-3 py-1">
🎉 Givesback Cash Awards Program
</div>
<h1 class="text-4xl lg:text-5xl font-bold text-foreground leading-tight">
Awards Up to <span class="text-green-600">$1,000</span> Weekly!
</h1>
<p class="text-xl text-muted-foreground leading-relaxed">
Join thousands of members who've received cash awards. Simple steps, real rewards.
</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-<?= (count($givesback_next_awards)>1) ? '4' : '3';?> gap-4">
<div class="text-center">
<div class="bg-green-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-2">
<i class="fas fa-dollar-sign h-6 w-6 text-green-600"></i>
</div>
<div class="text-2xl font-bold text-foreground">$<?= number_format($total_amount);?></div>
<div class="text-sm text-muted-foreground">Total Awarded</div>
</div>
<div class="text-center">
<div class="bg-blue-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-2">
<i class="fas fa-users h-6 w-6 text-blue-600"></i>
</div>
<div class="text-2xl font-bold text-foreground"><?= number_format($total_winners);?></div>
<div class="text-sm text-muted-foreground">Happy Winners</div>
</div>
<div class="text-center">
<div class="bg-orange-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-2">
<i class="fas fa-clock h-6 w-6 text-orange-600"></i>
</div>
<div class="text-2xl font-bold text-foreground"><?= date('M d', strtotime($givesback_next_awards[0]->winner_date));?></div>
<div class="text-sm text-muted-foreground">Next Award</div>
<div class="font-bold text-green-600">$<?= number_format($givesback_next_awards[0]->winner_amount);?></div>
</div>
<?php if(count($givesback_next_awards)>1) { ?>
<div class="text-center">
<div class="bg-purple-100 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-2">
<i class="fas fa-clock h-6 w-6 text-purple-600"></i>
</div>
<div class="text-2xl font-bold text-foreground"><?= date('M d', strtotime($givesback_next_awards[1]->winner_date));?></div>
<div class="text-sm text-muted-foreground">Next Award</div>
<div class="font-bold text-green-600">$<?= number_format($givesback_next_awards[1]->winner_amount);?></div>
</div>
<?php } ?>
</div>
<div class="bg-gradient-to-br from-blue-50 to-green-50 border border-blue-200 rounded-lg p-6">
<div class="space-y-4">
<p class="text-muted-foreground leading-relaxed">
In our ongoing commitment to help you achieve your funding goals and express our gratitude to our clients,
we're excited to introduce the <strong class="text-foreground">USA Givesback Cash Award Program</strong>.
Each week, select members are chosen at random to receive cash awards.
</p>
<div class="bg-white/70 rounded-lg p-4">
<h3 class="font-semibold text-foreground mb-3">How to Enter & Become Eligible:</h3>
<ol class="space-y-2 text-sm">
<li class="flex items-start gap-3">
<span class="bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-xs font-semibold flex-shrink-0 mt-0.5" style="min-width:15px;">1</span>
<span>Search our grant database and select your <strong>3 favorite grants</strong></span>
</li>
<li class="flex items-start gap-3">
<span class="bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-xs font-semibold flex-shrink-0 mt-0.5" style="min-width:15px;">2</span>
<span>Click the heart icon to mark them as favorites. With 3 favorites and an active account, you're eligible!</span>
</li>
<li class="flex items-start gap-3">
<span class="bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-xs font-semibold flex-shrink-0 mt-0.5" style="min-width:15px;">3</span>
<span>Verify your contact information so we can reach you if selected</span>
</li>
</ol>
</div>
<div class="text-center">
<p class="text-sm text-muted-foreground italic">
Winners are notified by email and text, and featured on our website.
<br />
<strong class="text-foreground">Thank you for being a valued USA Givesback client!</strong>
</p>
</div>
</div>
</div>
<p class="text-xs text-muted-foreground">
* No purchase necessary. Must be 18+ and have active account. Terms apply.
</p>
</div>
</div>
<!-- Right side - Winner Carousel -->
<div class="winner-carousel h-full">
<div class="relative h-full min-h-400px overflow-hidden">
<!-- Background Image -->
<div class="carousel-slide active">
<img src="https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=givesback_winners%2Fwinner_182.jpeg" alt="Winner holding their Givesback award check" class="absolute inset-0 w-full h-full object-cover">
<div class="absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"></div>
</div>
<div class="carousel-slide">
<img src="https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=givesback_winners%2Fwinner_176.jpg" alt="Winner holding their Givesback award check" class="absolute inset-0 w-full h-full object-cover">
<div class="absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"></div>
</div>
<div class="carousel-slide">
<img src="https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=givesback_winners%2Fwinner_171.jpg" alt="Winner holding their Givesback award check" class="absolute inset-0 w-full h-full object-cover">
<div class="absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"></div>
</div>
<!-- Carousel Indicators -->
<div class="absolute top-4 right-4 flex gap-2">
<button class="carousel-indicator active" data-slide="0"></button>
<button class="carousel-indicator" data-slide="1"></button>
<button class="carousel-indicator" data-slide="2"></button>
</div>
<!-- Winner Info Badge -->
<div class="absolute top-4 left-4">
<div class="bg-white/95 backdrop-blur-sm rounded-lg px-3 py-2 shadow-lg">
<div class="text-sm font-bold text-gray-900" id="slide_winner_name">Sara B</div>
<div class="text-xs text-green-600 font-semibold" id="slide_winner_amount">$250 Winner</div>
</div>
</div>
<!-- Floating Testimonial -->
<div class="absolute bottom-6 left-6 right-6">
<div class="card bg-white/95 backdrop-blur-sm border-0 shadow-lg animate-fade-in">
<div class="p-4">
<p class="text-sm italic text-gray-700 mb-2 line-clamp-3" id="slide_winner_quote">
"Thank you so much! I will us this money to fund my life long passion for airplanes and getting my pilots license. I cannot appreciate this enough."
</p>
<div class="flex items-center justify-between">
<div class="text-xs font-medium text-gray-900" id="slide_winner_name_2">
- Sara B, Recent Winner
</div>
<div class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full" id="slide_winner_amount_2">
$250
</div>
</div>
</div>
</div>
</div>
<!-- Progress Bar -->
<div class="absolute bottom-0 left-0 right-0 h-1 bg-black/20">
<div class="progress-bar h-full bg-white transition-all duration-300 ease-linear"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Status Card -->
<div class="status-card">
<div class="card shadow-lg border-0">
<div class="card-header pb-4">
<div class="flex items-center justify-between">
<div>
<h2 class="text-2xl">Ready to Enter Weekly Drawings?</h2>
<p class="text-muted-foreground">
Complete these 2 simple steps to be eligible
</p>
</div>
<div class="text-right">
<div class="text-3xl font-bold text-green-600" id="completion-percentage">0%</div>
<div class="text-sm text-muted-foreground">Complete</div>
</div>
</div>
</div>
<div class="card-content space-y-6 pt-0">
<!-- Success Message -->
<div id="success-message" class="text-center p-6 bg-blue-50 border border-blue-200 rounded-lg" style="display:none;">
<div class="text-green-600 text-3xl mb-2">🎉</div>
<h3 class="font-bold text-green-800 text-xl mb-1">Congratulations!</h3>
<p class="text-green-600 font-medium mb-1">You've been entered into the Givesback Cash Program!</p>
<p class="text-sm text-muted-foreground mt-2">You're now eligible for all upcoming weekly awards up to $1,000. Good luck!</p>
</div>
<!-- Step 1: Contact Information -->
<div class="status-step border border-border rounded-lg p-6 bg-muted/30" data-step="1">
<div class="flex items-start justify-between">
<div class="flex items-start gap-3">
<div class="w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold step-circle bg-muted text-muted-foreground">1</div>
<div>
<h3 class="font-semibold text-lg">Step 1: Contact Information</h3>
<div class="text-sm text-muted-foreground space-y-1 mt-1">
<div><span class="font-medium">Name:</span> <span id="contact-name"><?= $client_info->first.' '.$client_info->last;?></span></div>
<div><span class="font-medium">Email:</span> <span id="contact-email"><?= $client_info->email;?></span></div>
<div><span class="font-medium">Mobile:</span> <span id="contact-mobile"><?= $client_info->phone_1;?></span></div>
<div><span class="font-medium">Address:</span> <span id="contact-address"><?= $client_info->address1.' '.$client_info->city.', '.$client_info->state.' '.$client_info->zip;?></span></div>
</div>
<div class="text-sm text-green-600 font-medium mt-1 completed-date" style="display:none;"></div>
</div>
</div>
<div class="flex gap-2 step-actions">
<button class="btn btn-sm btn-outline" onclick="editContactInfo()">Edit</button>
<button class="btn btn-sm" onclick="confirmContactInfo()">Confirm</button>
</div>
</div>
</div>
<!-- Step 2: Favorited 3 Grants -->
<div class="status-step border border-border rounded-lg p-6 bg-muted/30" data-step="2">
<div class="flex items-start justify-between">
<div class="flex items-start gap-3">
<div class="w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold step-circle bg-muted text-muted-foreground">2</div>
<div>
<h3 class="font-semibold text-lg">Step 2: Favorited 3 Grants</h3>
<div class="text-sm text-muted-foreground mt-1">
<p class="mb-2">Mark 3 grants as favorites in our database</p>
</div>
<div class="text-sm text-muted-foreground mt-1" id="favorited_grants_list">
<?php if(!empty($favorited_list)) {
foreach($favorited_list as $grant_name) { ?>
<div>✅ <?= $grant_name;?></div>
<?php }
} ?>
</div>
<div class="text-sm text-green-600 font-medium mt-1 completed-date" style="display:none;"></div>
</div>
</div>
<div class="flex gap-2 step-actions">
<?php /*<a href="/vx/usa/applications/" class="btn btn-sm btn-outline">Find 3 Grants to Favorite</a>*/ ?>
</div>
</div>
<h3 class="font-semibold text-lg mt-4">Here are our most Favorited Applications. Please Select 3 from the list below:</h3>
<div id="most_favorited_list">
<?php if(!empty($most_favorited)) {
$i=0;
$j=0;
foreach($most_favorited as $m) {
if($i%30==0) {
$j++;
}
$i++;
?>
<div class="flex items-start justify-between grant_container show_more_<?= $j;?>" <?= ($i>30) ? 'style="display:none;"' : '';?>>
<div class="flex gap-2">
<div style="max-width:50rem;">
<div><strong><?= $m->name;?></strong></div>
<div><?= stripslashes($m->brief_summary);?></div>
</div>
</div>
<div class="flex gap-2">
<div style="color:gray;">
<div>DEADLINE</div>
<div><?= ($m->deadline=='0000-00-00') ? 'No Deadline' : date('M d, Y',strtotime($m->deadline));?></div>
</div>
</div>
<div class="flex gap-2">
<div style="color:#7ea62f;">
<div>AMOUNT</div>
<div><?= (empty($m->amount*1)) ? 'Amount Varies' : '$'.number_format(round($m->amount));?></div>
</div>
</div>
<div class="flex gap-2">
<div>
<div>FUNDING TYPE</div>
<div><?= $m->type_name;?></div>
</div>
</div>
<div class="flex gap-2" id="favorites_and_web_buttons">
<div class="favoriteOpen" onclick="mark_as_favorite(this,'<?= $m->grants_id;?>'); refresh_favorited_list(); return false;">
<div class="rib center-center">
<span class="glyphicons gray f28 <?= (in_array($m->grants_id,$favorited_list_ids)) ? 'favoriteSelected glyphicons-heart' : 'favorite glyphicons-heart-empty';?>" style="margin-top:11px;"></span>
<div class="rb text">
Favorite
</div>
</div>
<div class="rib center-center" style="width:0px; height:100%; margin-left:-3px;"></div>
</div>
<a href="<?= $m->url;?>" target="_blank" rel="nofollow" class="go_to_site_button">
<center>
<div><img src="/vx/usa/images/gotosite.png" style="width:30px;" /></div>
<div class="rb text" style="color:#0093d9;padding-top:8px;">
Go To Site
</div>
</center>
</a>
</div>
</div>
<?php if($i==30) { ?>
<center style="padding:20px;">
<button class="btn btn-sm btn-outline" onclick="$(this).parent('center:first').remove(); $('.show_more_<?= $j+1;?>').show(); return false;">Show More</button>
</center>
<?php } elseif($i==60) { ?>
<center class="show_more_<?= $j;?>" style="display:none;padding:20px;">
<a href="/vx/usa/applications/" class="btn btn-sm btn-outline">Not finding what you are looking for? Search our full application database.</a>
</center>
<?php } ?>
<?php }
} ?>
</div>
</div>
</div>
</div>
</div>
<!-- Testimonials Grid -->
<div class="testimonials-grid">
<div class="space-y-6">
<div class="text-center">
<h2 class="text-3xl font-bold text-foreground mb-2">Past Award Recipients</h2>
<p class="text-muted-foreground">See what our winners have to say</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 testimonial_cards">
<?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)) {
?>
<div class="card hover:shadow-lg transition-all duration-300 hover:-translate-y-1">
<?php if(!empty($tr->picture_location)) { ?>
<div class="aspect-video bg-muted rounded-t-lg overflow-hidden">
<img loading="lazy" decoding="async" alt="<?= $tr->tcres[0]->first.' testimonial';?>" src="https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=<?= urlencode($tr->picture_location);?>" onerror="$(this).remove();" class="w-full h-full object-cover" />
</div>
<?php } ?>
<div class="card-content p-6">
<div class="mb-4">
<h4 class="font-semibold text-lg text-foreground"><?= ucwords(strtolower($tcres[0]->first.' '.substr($tcres[0]->last,0,1)));?></h4>
<div class="badge variant-secondary text-xs">awarded on <?= date('M d, Y',strtotime($tr->money_sent));?></div>
</div>
<blockquote class="text-muted-foreground italic leading-relaxed">
"<?= $tr->how_use_money;?>"
</blockquote>
</div>
</div>
<?php }
} ?>
</div>
</div>
</div>
</div>
</main>
</div>
<!-- Contact Info Edit Modal -->
<div id="contact-modal" class="modal hidden">
<div class="modal-content">
<div class="modal-header">
<h3>Edit Contact Information</h3>
<button class="modal-close" onclick="closeContactModal()">×</button>
</div>
<div class="modal-body">
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<div>
<label class="text-xs font-medium text-muted-foreground">First Name</label>
<input type="text" id="edit-first_name" placeholder="Enter first name" class="input text-sm mt-1" value="<?= $client_info->first;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">Last Name</label>
<input type="text" id="edit-last_name" placeholder="Enter last name" class="input text-sm mt-1" value="<?= $client_info->last;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">Email</label>
<input type="email" id="edit-email" placeholder="Enter email" class="input text-sm mt-1" value="<?= $client_info->email;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">Mobile</label>
<input type="tel" id="edit-mobile" placeholder="Enter mobile" class="input text-sm mt-1" value="<?= $client_info->phone_1;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">Street Address</label>
<input type="text" id="edit-street_address" placeholder="Enter address" class="input text-sm mt-1" value="<?= $client_info->address1;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">City</label>
<input type="text" id="edit-city" placeholder="Enter city" class="input text-sm mt-1" value="<?= $client_info->city;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">State</label>
<input type="text" id="edit-state" placeholder="Enter state" class="input text-sm mt-1" value="<?= $client_info->state;?>">
</div>
<div>
<label class="text-xs font-medium text-muted-foreground">Zip</label>
<input type="text" id="edit-zip" placeholder="Enter zip" class="input text-sm mt-1" value="<?= $client_info->zip;?>">
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-sm" onclick="saveContactInfo()">Save All</button>
<button class="btn btn-sm btn-outline" onclick="closeContactModal()">Cancel</button>
</div>
</div>
</div>
<script type="text/javascript">
// Countdown Timer Functionality
class CountdownTimer {
constructor(targetDate) {
this.targetDate = new Date(targetDate);
this.daysElement = document.getElementById('days');
this.hoursElement = document.getElementById('hours');
this.minutesElement = document.getElementById('minutes');
this.secondsElement = document.getElementById('seconds');
this.updateTimer();
this.startTimer();
}
updateTimer() {
const now = new Date();
const difference = this.targetDate - now;
if (difference > 0) {
const days = Math.floor(difference / (1000 * 60 * 60 * 24));
const hours = Math.floor((difference / (1000 * 60 * 60)) % 24);
const minutes = Math.floor((difference / 1000 / 60) % 60);
const seconds = Math.floor((difference / 1000) % 60);
this.daysElement.textContent = days;
this.hoursElement.textContent = hours;
this.minutesElement.textContent = minutes;
this.secondsElement.textContent = seconds;
} else {
// Countdown finished
this.daysElement.textContent = '0';
this.hoursElement.textContent = '0';
this.minutesElement.textContent = '0';
this.secondsElement.textContent = '0';
}
}
startTimer() {
setInterval(() => {
this.updateTimer();
}, 1000);
}
}
// Winner Carousel Functionality
class WinnerCarousel {
constructor() {
this.currentIndex = 0;
this.slides = document.querySelectorAll('.carousel-slide');
this.indicators = document.querySelectorAll('.carousel-indicator');
this.progressBar = document.querySelector('.progress-bar');
this.winners = [
{
name: "Sara B",
image: "https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=givesback_winners%2Fwinner_182.jpeg",
quote: "Thank you so much! I will us this money to fund my life long passion for airplanes and getting my pilots license. I cannot appreciate this enough.",
amount: "$250",
date: "August 08 Winner"
},
{
name: "Karen M",
image: "https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=givesback_winners%2Fwinner_176.jpg",
quote: "I will be using the money for a community event for the 4800 block of Warnock street. The City of Philadelphia will be honoring our block for our participation in the clean street program with Philadelphia more better beautiful. The second week of September 2025.",
amount: "$250",
date: "June 30 Winner"
},
{
name: "Natacha C",
image: "https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file=givesback_winners%2Fwinner_171.jpg",
quote: "Thank you for your generous donation. I appreciate your support more than words can express.",
amount: "$1,000",
date: "May 22 Winner"
}
];
this.init();
}
init() {
this.setupIndicators();
this.startAutoPlay();
this.updateProgressBar();
}
setupIndicators() {
this.indicators.forEach((indicator, index) => {
indicator.addEventListener('click', () => {
this.goToSlide(index);
});
});
}
goToSlide(index) {
// Remove active class from current slide and indicator
this.slides[this.currentIndex].classList.remove('active');
this.indicators[this.currentIndex].classList.remove('active');
// Update current index
this.currentIndex = index;
// Add active class to new slide and indicator
this.slides[this.currentIndex].classList.add('active');
this.indicators[this.currentIndex].classList.add('active');
//Update the text overlays
$('#slide_winner_amount').html(this.winners[this.currentIndex].amount + ' Winner');
$('#slide_winner_amount_2').html(this.winners[this.currentIndex].amount);
$('#slide_winner_name').html('- ' + this.winners[this.currentIndex].name + ', ' + this.winners[this.currentIndex].date);
$('#slide_winner_name_2').html(this.winners[this.currentIndex].name);
$('#slide_winner_quote').html(this.winners[this.currentIndex].quote);
// Update progress bar
this.updateProgressBar();
}
nextSlide() {
const nextIndex = (this.currentIndex + 1) % this.slides.length;
this.goToSlide(nextIndex);
}
startAutoPlay() {
setInterval(() => {
this.nextSlide();
}, 5000);
}
updateProgressBar() {
const progress = ((this.currentIndex + 1) / this.slides.length) * 100;
this.progressBar.style.width = `${progress}%`;
}
}
// Status Management System
class StatusManager {
constructor() {
this.contactInfo = {
first_name: "<?= $client_info->first;?>",
last_name: "<?= $client_info->last;?>",
email: "<?= $client_info->email;?>",
mobile: "<?= $client_info->phone_1;?>",
street_address: "<?= $client_info->address1;?>",
city: "<?= $client_info->city;?>",
state: "<?= $client_info->state;?>",
zip: "<?= $client_info->zip;?>"
};
this.state = {
contactConfirmed: <?= (!empty($confirmed['name'])) ? 'true' : 'false';?>,
contactDate: <?= (!empty($confirmed['name'])) ? '"'.$confirmed['name'].'"' : 'null';?>,
favoritesConfirmed: <?= (!empty($confirmed['favorites'])) ? 'true' : 'false';?>,
favoritesDate: <?= (!empty($confirmed['favorites'])) ? '"'.$confirmed['favorites'].'"' : 'null';?>
};
this.elements = {
steps: Array.from(document.querySelectorAll('.status-step')),
completion: document.getElementById('completion-percentage'),
success: document.getElementById('success-message')
};
this.init();
}
init() {
this.applyInitialState();
this.updateCompletion();
}
applyInitialState() {
// Step 1: Contact
this.updateStepUI(1, this.state.contactConfirmed, this.state.contactDate);
// Step 2: Favorites
this.updateStepUI(2, this.state.favoritesConfirmed, this.state.favoritesDate);
}
updateStepUI(stepNumber, isConfirmed, dateStr) {
const stepEl = document.querySelector(`.status-step[data-step="${stepNumber}"]`);
if (!stepEl) return;
const circle = stepEl.querySelector('.step-circle');
const actions = stepEl.querySelector('.step-actions');
const completedDate = stepEl.querySelector('.completed-date');
if (isConfirmed) {
circle.textContent = '✓';
circle.classList.remove('bg-muted', 'text-muted-foreground');
circle.classList.add('bg-green-500', 'text-white');
if (actions) actions.style.display = 'none';
if (completedDate) {
completedDate.style.display = 'block';
completedDate.textContent = dateStr ? `✅ Completed ${dateStr}` : '✅ Completed';
}
} else {
circle.textContent = String(stepNumber);
circle.classList.remove('bg-green-500', 'text-white');
circle.classList.add('bg-muted', 'text-muted-foreground');
if (actions) actions.style.display = 'flex';
if (completedDate) completedDate.style.display = 'none';
}
}
updateCompletion() {
const total = 2;
const completed = (this.state.contactConfirmed ? 1 : 0) + (this.state.favoritesConfirmed ? 1 : 0);
const pct = Math.round((completed / total) * 100);
if (this.elements.completion) this.elements.completion.textContent = `${pct}%`;
if (this.elements.success) this.elements.success.style.display = (pct === 100) ? 'block' : 'none';
}
confirmContactInfo() {
// Persist on server
$.ajax({
url: '/vx/usa/givesback/',
type: 'POST',
cache: false,
data: { action: 'confirm_step', name: 'name' },
success: () => {
this.state.contactConfirmed = true;
this.state.contactDate = new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
this.updateStepUI(1, true, this.state.contactDate);
this.updateCompletion();
}
});
}
updateContactInfo(newInfo) {
this.contactInfo = { ...this.contactInfo, ...newInfo };
// Update display
document.getElementById('contact-name').textContent = this.contactInfo.first_name + ' ' + this.contactInfo.last_name;
document.getElementById('contact-email').textContent = this.contactInfo.email;
document.getElementById('contact-mobile').textContent = this.contactInfo.mobile;
document.getElementById('contact-address').textContent = this.contactInfo.street_address + ', ' + this.contactInfo.city + ', ' + this.contactInfo.state + ' ' + this.contactInfo.zip;
//actually send the stuff to be updated
var querystring = 'action=update_contact_info&first_name=' + encodeURIComponent(this.contactInfo.first_name) + "&last_name=" + encodeURIComponent(this.contactInfo.last_name) + "&email=" + encodeURIComponent(this.contactInfo.email) + "&phone=" + encodeURIComponent(this.contactInfo.mobile) + "&street_address=" + encodeURIComponent(this.contactInfo.street_address) + "&city=" + encodeURIComponent(this.contactInfo.city) + "&state=" + encodeURIComponent(this.contactInfo.state) + "&zip=" + encodeURIComponent(this.contactInfo.zip);
$.ajax({
url:"/vx/usa/givesback/",
cache: false,
type: "POST",
data: querystring,
success: function(results) {
}
});
}
}
// Modal Management
class ModalManager {
constructor() {
this.contactModal = document.getElementById('contact-modal');
this.init();
}
init() {
// Close modal when clicking outside
this.contactModal.addEventListener('click', (e) => {
if (e.target === this.contactModal) {
this.closeContactModal();
}
});
// Close modal with Escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
this.closeContactModal();
}
});
}
openContactModal() {
this.contactModal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
closeContactModal() {
this.contactModal.classList.add('hidden');
document.body.style.overflow = 'auto';
}
}
// Global Functions for HTML onclick handlers
let statusManager;
let modalManager;
function editContactInfo() {
modalManager.openContactModal();
}
function closeContactModal() {
modalManager.closeContactModal();
}
function saveContactInfo() {
const newInfo = {
first_name: document.getElementById('edit-first_name').value,
last_name: document.getElementById('edit-last_name').value,
email: document.getElementById('edit-email').value,
mobile: document.getElementById('edit-mobile').value,
street_address: document.getElementById('edit-street_address').value,
city: document.getElementById('edit-city').value,
state: document.getElementById('edit-state').value,
zip: document.getElementById('edit-zip').value
};
statusManager.updateContactInfo(newInfo);
modalManager.closeContactModal();
}
function confirmContactInfo() {
statusManager.confirmContactInfo();
}
// Initialize everything when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
// Initialize countdown timer
<?php $next_winner = date('Y-m-d',strtotime('next monday')).'T11:10:00';?>
new CountdownTimer('<?= $next_winner;?>');
// Initialize winner carousel
new WinnerCarousel();
// Initialize status manager
statusManager = new StatusManager();
// Initialize modal manager
modalManager = new ModalManager();
// Add some interactive enhancements
addHoverEffects();
addSmoothScrolling();
});
// Additional UI Enhancements
function addHoverEffects() {
// Add hover effects to cards
const cards = document.querySelectorAll('.card');
cards.forEach(card => {
card.addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-4px)';
this.style.transition = 'transform 0.3s ease';
});
card.addEventListener('mouseleave', function() {
this.style.transform = 'translateY(0)';
});
});
}
function addSmoothScrolling() {
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
}
// Add loading animation
window.addEventListener('load', function() {
document.body.classList.add('loaded');
// Add fade-in animation to main content
const mainContent = document.querySelector('main');
if (mainContent) {
mainContent.style.opacity = '0';
mainContent.style.transform = 'translateY(20px)';
mainContent.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
setTimeout(() => {
mainContent.style.opacity = '1';
mainContent.style.transform = 'translateY(0)';
}, 100);
}
});
function refresh_favorited_list() {
var querystring = 'action=refresh_favorited_list';
$.ajax({
url:"/vx/usa/givesback/",
cache: false,
type: "POST",
data: querystring,
dataType: 'json',
success: function(results) {
var html = '';
if(results.favorites.length>0) {
for(i in results.favorites) {
html += '<div>✅ ' + results.favorites[i] + '</div>';
}
if(results.date_favorited) {
statusManager.state.favoritesConfirmed = true;
statusManager.state.favoritesDate = results.date_favorited;
} else {
statusManager.state.favoritesConfirmed = false;
statusManager.state.favoritesDate = '';
}
statusManager.init();
}
$('#favorited_grants_list').html(html);
}
});
}
</script>
<?php
$body = ob_get_clean();
$title = "Gives Back : ".$_SESSION['site_name'];
include($_SERVER['DOCUMENT_ROOT'].'/vx/usa/layout/non_angular_layout.php');
?>