| 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/applications/ |
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');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/States.php');
$user = $_SESSION['user'];
if(!empty($_POST['grants_id'])) {
$grant_list = $db->get_results("SELECT g.grants_id as id,g.grants_id as grants_id,t.name as grant_type,ggl.bg_color_hex,ggl.logo_url,g.name,g.amount,g.deadline,g.who,g.requirements,g.description,g.url,g.base_url,g.funding_type,g.department,g.agency,g.term_of_contract,g.contact_information,g.preapplication_information,g.additional_eligibility_requirements,g.org_name,g.org_address,g.org_city,g.org_state,g.org_zip,g.org_phone1,g.org_email,g.org_url,g.only_available_state,g.only_available_gender
FROM grdb.grd_grants g
LEFT JOIN grdb.grd_types t ON g.types_id=t.types_id
LEFT JOIN grdb.grd_site_logos ggl ON ggl.site_domain=g.base_url AND ggl.status='active'
WHERE g.grants_id='".$db->clean($_POST['grants_id'])."'
GROUP BY grants_id");
}
$j=0; foreach($grant_list as $grant) { $j++;
$my_favorites_count = 0;
$mfres = $db->get_results("SELECT COUNT(*) as c FROM grdb.grd_usa_saved_grants WHERE grants_id='".$db->clean($grant->grants_id)."'");
if(!empty($mfres)) {
$my_favorites_count = $mfres[0]->c;
}
$is_popular = $db->get_results("SELECT id FROM grdb.popular_grants WHERE grants_id='".$db->clean($grant->grants_id)."'");
$pop_grant_border = '1px solid black;border-radius:0px;';
if(!empty($is_popular)) {
$pop_grant_border = '1px solid #024e63;border-radius:0px;';
} elseif(strtotime($grant->ts) >= strtotime('-30 day')) {
$pop_grant_border = '1px solid #ffa732;border-radius:0px;';
}
?>
<div style="position:absolute;top:0px;left:0px;">
<div style="display:inline-block;vertical-align:top;">
<?php if(!empty($is_popular)) { ?>
<div style="width:40px;height:40px;background:#024e63;color:white;padding:5px 10px;">
<div><i class="fas fa-trophy" style="font-size:18px;color:white;"></i></div>
<div style="text-align:center;font-size:10px;">Top</div>
</div>
<?php } elseif(strtotime($grant->ts) >= strtotime('-30 day')) { ?>
<div style="width:40px;height:40px;background:#ffa732;color:white;padding:5px 10px;">
<div><i class="fas fa-star" style="font-size:18px;"></i></div>
<div style="text-align:center;font-size:10px;">New</div>
</div>
<?php } ?>
</div>
</div>
<div style="position:absolute;top:0px;right:5px;">
<div style="display:inline-block;" onclick="mark_as_favorite(this,'<?= $grant->grants_id;?>'); return false;">
<i class="glyphicons <?= (!empty($grant->favorite)) ? 'favoriteSelected glyphicons-heart' : 'favorite glyphicons-heart-empty';?>" style="color:red;vertical-align:middle;"></i> <i style="color:gray;vertical-align:middle;margin-left:-8px;"><?= number_format($my_favorites_count);?></i>
</div>
<?php if($grant->has_additional_fee_to_apply=='Yes') { ?>
<div style="display:inline-block;">
<i class="fas fa-circle-dollar" style="color:#8c8525;font-size:20px;cursor:pointer;" onmouseover="$(this).parents('.pop_grant').find('.has_additional_fee').show();" onmouseout="$(this).parents('.pop_grant').find('.has_additional_fee').hide();" onclick="$(this).parents('.pop_grant').find('.has_additional_fee').toggle(); return false;"></i>
<div class="has_additional_fee" style="display:none;position:absolute;top:-50px;left:10px;font-size:10px;padding:10px;border:1px solid black;background:white;z-index:2;width:135px;">This funding source may ask for a fee to apply.</div>
</div>
<?php } ?>
</div>
<div style="height:40px;"> </div>
<?php if($grant->has_additional_fee_to_apply=='Yes') { ?>
<div style="position:absolute;top:5px;right:5px;z-index:1;">
<i class="fas fa-circle-dollar" style="color:#8c8525;font-size:32px;cursor:pointer;" onmouseover="$(this).parents('td:first').find('.has_additional_fee').show();" onmouseout="$(this).parents('td:first').find('.has_additional_fee').hide();" onclick="$(this).parents('td:first').find('.has_additional_fee').toggle(); return false;"></i>
<div class="has_additional_fee" style="display:none;position:absolute;top:-50px;left:20px;font-size:10px;padding:10px;border:1px solid black;background:white;z-index:2;width:135px;">This funding source may ask for a fee to apply.</div>
</div>
<?php } ?>
<div class="grant_container">
<h3>
<?= strip_imported_junk($grant->name);?>
<?php if(!empty($_SESSION['cs_tracking_username'])) { ?>
<i class="fa fa-pencil" style="cursor:pointer;" title="Edit" onclick="edit_grant_info('<?= $grant->grants_id;?>'); return false;"></i>
<?php } ?>
</h3>
<div>
<?php if(!empty($grant->logo_url)) { ?>
<img src="<?= $grant->logo_url;?>" loading="lazy" style="max-width:90%;max-height:100px;margin-bottom:10px;<?= (!empty($grant->bg_color_hex)) ? 'background:'.$grant->bg_color_hex : '';?>" onerror="$(this).remove();" />
<?php } else { ?>
<img src="https://surfcrm.com/images/grdb/<?= $grant->base_url;?>.jpg" loading="lazy" style="max-width:90%;height:100px;margin-bottom:10px;" onerror="$(this).remove();" />
<?php } ?>
</div>
<div>
<?php if(!empty($grant->description)) { ?>
<h4>DESCRIPTION</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->description);?></div>
<?php } ?>
<?php if(!empty($grant->requirements)) { ?>
<h4>REQUIREMENTS</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->requirements);?></div>
<?php } ?>
<?php if(!empty($grant->additional_eligibility_requirements)) { ?>
<h4>ADDITIONAL ELIGIBILITY REQUIREMENTS</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->additional_eligibility_requirements);?></div>
<?php } ?>
<?php if(!empty($grant->funding_type)) { ?>
<h4>AGENCY TYPE</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->funding_type);?></div>
<?php } ?>
<?php if(!empty($grant->term_of_contract)) { ?>
<h4>TERM OF CONTRACT</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->term_of_contract);?></div>
<?php } ?>
<?php if(!empty($grant->contact_information)) { ?>
<h4>CONTACT INFORMATION</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->contact_information);?></div>
<?php } ?>
<?php if(!empty($grant->preapplication_information)) { ?>
<h4>PRE-APPLICATION INFORMATION</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= strip_imported_junk($grant->preapplication_information);?></div>
<?php } ?>
<?php if(!empty($grant->org_name)) { ?>
<h4>ORGANIZATION INFO</h4>
<div class="grant_p" style="padding-bottom:10px;">
<table>
<?php if(!empty($grant->org_name)) { ?>
<tr>
<td style="white-space:nowrap;">Name:</td>
<td><?= strip_imported_junk($grant->org_name);?></td>
</tr>
<?php } ?>
<?php if(!empty($grant->address)) { ?>
<tr>
<td style="white-space:nowrap;">Address:</td>
<td>
<?= $grant->org_address;?><br />
<?= $grant->org_city.', '.$grant->org_state.', '.$grant->org_zip;?>
</td>
</tr>
<?php } ?>
<?php if(!empty($grant->org_phone1)) { ?>
<tr>
<td style="white-space:nowrap;">Phone:</td>
<td><?= $grant->org_phone1;?></td>
</tr>
<?php } ?>
<?php if(!empty($grant->org_email)) { ?>
<tr>
<td style="white-space:nowrap;">Email:</td>
<td><?= $grant->org_email;?></td>
</tr>
<?php } ?>
<?php if(!empty($grant->org_url)) { ?>
<tr>
<td style="white-space:nowrap;">Website:</td>
<td><?= $grant->org_url;?></td>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
<?php if(!empty($grant->who_can_apply)) { ?>
<h4>WHO CAN APPLY</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= $grant->who_can_apply;?></div>
<?php } ?>
<?php if(!empty($grant->only_available_state)) { ?>
<h4>AVAILABLE STATES</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= pretty_state_list($grant->only_available_state);?></div>
<?php } ?>
<?php if(!empty(pretty_gender_list($grant->only_available_gender))) { ?>
<h4>AVAILABLE GENDERS</h4>
<div class="grant_p" style="padding-bottom:10px;"><?= pretty_gender_list($grant->only_available_gender);?></div>
<?php } ?>
<?php if($needs_show_more) { ?>
<center><a href="#" onclick="$(this).parent().hide(); $('.short_version').hide(); $('.full_version').show(); return false;"><u>Read More</u></a></center>
<?php } ?>
</div>
</div>
<div class="rb">
<?php if(!empty($on_organizer)) { ?>
<div style="text-align:right;margin-bottom:10px;">
<div>
<div style="display:inline-block;vertical-align:top;">
<div class="organizer_filling organizer_type <?= (!empty($grant->filling)) ? 'organizer_selected' : '';?>" onclick="mark_as_filling(this, '<?= $grant->grants_id;?>'); return false;">
<div><i class="fas fa-file-invoice-dollar" style="font-size:24px;"></i></div>
<div style="font-size:8px;">Filling Out</div>
</div>
</div>
<div style="display:inline-block;vertical-align:top;">
<div class="organizer_submitted organizer_type <?= (!empty($grant->submitted)) ? 'organizer_selected' : '';?>" onclick="mark_as_submitted(this, '<?= $grant->grants_id;?>'); return false;">
<div><i class="fas fa-paper-plane" style="font-size:24px;"></i></div>
<div style="font-size:8px;">Submitted</div>
</div>
</div>
<div style="display:inline-block;vertical-align:top;">
<div class="organizer_denied organizer_type <?= (!empty($grant->denied)) ? 'organizer_selected' : '';?>" onclick="mark_as_denied(this, '<?= $grant->grants_id;?>'); return false;">
<div><i class="fas fa-thumbs-down" style="font-size:24px;"></i></div>
<div style="font-size:8px;">Denied</div>
</div>
</div>
<div style="display:inline-block;vertical-align:top;">
<div class="organizer_approved organizer_type <?= (!empty($grant->approved)) ? 'organizer_selected' : '';?>" onclick="mark_as_approved(this, '<?= $grant->grants_id;?>'); return false;">
<div><i class="fas fa-thumbs-up" style="font-size:24px;"></i></div>
<div style="font-size:8px;">Approved</div>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="rb">
<?php $cats = $db->get_results("SELECT gc.id,gc.parent_id,gc.category_name
FROM grdb.grant_categories_new_grants gcg
LEFT JOIN grdb.grant_categories_new gc ON gc.id=gcg.grant_categories_id
WHERE grants_id='".$db->clean($grant->grants_id)."'
ORDER BY parent_id ASC,category_name ASC");
//$db->debug();
$main_cats = array();
$sub_cats = array();
$cat_list = array();
$subcat_list = array();
$subsubcat_list = array();
foreach($cats as $c) {
if($c->parent_id==0) {
$main_cats[] = $c->id;
$cat_list[] = $c->category_name;
} else {
if(in_array($c->parent_id,$sub_cats)) {
$subsubcat_list[] = $c->category_name;
} else {
$subcat_list[] = $c->category_name;
}
$sub_cats[] = $c->id;
}
}
if(!empty($cat_list)) {
?>
<div class="f12" style="color:#5125ad">Categories</div>
<div class="f12 bold" style="color:#5125ad;padding-bottom:10px;">
<?= implode(', ',$cat_list);?>
</div>
<?php
}
if(!empty($subcat_list)) {
?>
<div class="f12" style="color:#bb285c;">Sub-Categories</div>
<div class="f12 bold" style="color:#bb285c;padding-bottom:10px;">
<?= implode(', ',$subcat_list);?>
</div>
<?php
}
if(!empty($subsubcat_list)) {
?>
<div class="f12" style="color:#d68226;">Sub-Categories</div>
<div class="f12 bold" style="color:#d68226;padding-bottom:10px;">
<?= implode(', ',$subsubcat_list);?>
</div>
<?php
}
?>
</div>
<div style="margin-top:10px;padding:10px;">
<div class="row">
<div class="col-xs-6">
<div class="f10">Deadline</div>
<h4><?= ($grant->deadline=='0000-00-00' || strtotime($grant->deadline) <= strtotime('2001-01-01')) ? 'No Deadline' : date('M d, Y',strtotime($grant->deadline));?></h3>
<div class="f10" style="color:#7ea62f;">Amount</div>
<h4 style="color:#7ea62f;"><?= (empty($grant->amount*1)) ? 'Amount Varies' : '$'.number_format(round($grant->amount));?></h3>
<div class="f10 gray">Funding Type</div>
<h4 class="gray" title="<?= $grant->grant_type;?>">
<div class="rib" style="margin-left:2px;">
<?= $grant->grant_type;?>
</div>
<?php
switch($grant->grant_type) {
case 'Investor':
?><i class="fa fa-fw fa-diamond f22"></i><?php
break;
case 'Grant':
default:
?><i class="fa fa-fw fa-gift f22"></i><?php
break;
case 'Loan':
case 'Forgivable Loan':
?><i class="fa fa-fw fa-money f22"></i><?php
break;
case 'Other':
case 'Assistance Program':
?><i class="fa fa-fw fa-life-ring f22"></i><?php
break;
case 'Contract':
?><i class="fa fa-fw fa-file-text-o f22"></i><?php
break;
case 'Scholarship':
?><i class="fa fa-fw fa-user-graduate f22"></i><?php
break;
}
?>
</h4>
</div>
<div class="col-xs-6" style="padding-top:5px;">
<?php $has_video = $db->get_results("SELECT grants_id,folder,filename FROM grdb.grd_grant_video_tutorials WHERE grants_id='".$db->clean($grant->grants_id)."'");
if(!empty($has_video)) { ?>
<div onclick="play_tutorial_video('<?= $has_video[0]->folder.$has_video[0]->filename;?>','<?= $has_video[0]->grants_id;?>'); return false;" style="text-align:left;color:red;">
<div class="row">
<div class="col-xs-4">
<span class="fas fa-circle-play f32" style="vertical-align:middle;padding:0px 8px;"></span>
</div>
<div class="col-xs-8">
<div class="rib text" style="font-size:12px;font-weight:bold;color:gray;vertical-align:middle;padding-top:8px;">
Video Tutorial
</div>
</div>
</div>
</div>
<?php } ?>
<div onclick="mark_as_favorite(this,'<?= $grant->grants_id;?>'); return false;" style="text-align:left;margin-top:5px;">
<div class="row">
<div class="col-xs-4">
<span class="glyphicons gray f32 <?= (!empty($grant->favorite)) ? 'favoriteSelected glyphicons-heart' : 'favorite glyphicons-heart-empty';?>" style="vertical-align:middle;"></span>
</div>
<div class="col-xs-8">
<div class="rib text" style="font-size:12px;font-weight:bold;vertical-align:middle;padding-top:14px;">
Favorite
</div>
</div>
</div>
</div>
<div style="text-align:left;margin-top:-2px;">
<a href="<?= $grant->url;?>" class="btn btn-lg" target="_blank" style="display:block;text-align:left;padding:5px;">
<div class="row">
<div class="col-xs-4">
<img src="/vx/usa/images/gotosite.png" style="width:32px;vertical-align:middle;margin:0px 2px;" />
</div>
<div class="col-xs-8">
<div class="rib text" style="font-size:12px;font-weight:bold;color:#0093d9;vertical-align:middle;">
Go To Site
</div>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="row" style="margin-top:10px;">
<center>
<div style="color:#999999;font-size:10px;cursor:pointer;" onclick="mark_as_ignored(this,'<?= $grant->grants_id;?>'); return false;">Not Interested? Click here to hide.</div>
</center>
</div>
</div>
</div>
<div style="margin-top:10px;padding:10px;text-align:center;">
<a href="#" style="color:#666666;font-style:italic;" onclick="load_less_grant_info(this,'<?= $grant->grants_id;?>'); return false;">Show Less Information</a>
</div>
<?php } ?>