| 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/grant/ |
Upload File : |
<?
/**
* This framework has been created for a multitude of grant research websites.
*
* @copyright 2016-2021 Synergy Pro Marketing
* @author Aaron Campbell <aaron@synergymentoring.com>
* @license None, All Rights Reserved
* @package Business
*/
include_once($_SERVER['DOCUMENT_ROOT']."/vx/lib/inc.php");
include_once("../lib/formalizeGrants.php");
$grant = $_REQUEST['grant'];
if(empty($grant))
{
$grant = $_POST['grant'];
}
if(empty($grant))
{
$grant = $_GET['grant'];
}
$grant = ($grant * 1);
if($grant > 0)
{
$grantData = $db->query("
SELECT
*
FROM grdb.grd_grants
WHERE
grants_id = '$grant'
");
}
if(empty($grant) || count($grantData) == 0)
{
header("Location: /vx/usa/");
}
if(!empty($grant) && count($grantData) > 0)
{
/*$hasTrending = $db->query("
SELECT
*
FROM grdb.grd_trending
WHERE
grants_id = '$grant'
");
if(count($hasTrending) == 0)
{
$db->query("
INSERT INTO grdb.grd_trending
SET
grants_id = '$grant',
rank = 1,
datetime_entered = NOW()
");
}
else
{
$db->query("
UPDATE grdb.grd_trending
SET
rank = '".(($hasTrending[0]['rank'] * 1) + 0.25)."'
WHERE
grants_id = '$grant'
");
}*/
$grant = ($grant * 1);
$grantDetails = $db->query("
SELECT
gg.*,
gusg.id AS favorite,
gga.did_apply,
gga.how_much_applied_for,
gt.name AS grant_type
FROM grdb.grd_grants AS gg
LEFT JOIN grdb.grd_grants_categories AS ggc
ON gg.grants_id = ggc.grants_id
LEFT JOIN grdb.grd_grants_applied AS gga
ON
gga.grants_id = gg.grants_id
AND
gga.user = '$user'
AND
gga.site_code = '$siteCode'
LEFT JOIN grdb.grd_usa_saved_grants AS gusg
ON
gusg.grants_id = gg.grants_id
AND
gusg.client_id = '$user'
AND
gusg.site_code = '$siteCode'
LEFT JOIN grdb.grd_types AS gt
ON gt.types_id = gg.types_id
WHERE
gg.grants_id = '$grant'
GROUP BY gg.grants_id
ORDER BY gg.deadline ASC, gg.amount DESC
");
//echo $db->debug();
$grantDetails = formalizeGrants($grantDetails, $userDB, $states, $db, $user);
$grantDetails = $grantDetails[0];
//echoPre($grantDetails);
track_member_action('Opened Grant',$grantDetails['name']);
}
?>
<div class="rb p20 white-bg">
<div class="rb f24 bold">
<div class="rib">
{{thisgrant.name}}
<div class="rb f18 bold gray <?=$phone ? 'pt10' : ''?>"
title="{{grantTypeTitle(thisgrant.grant_type)}}">
<i class="fa fa-fw fa-diamond f18" ng-if="thisgrant.grant_type == 'Investor'"></i>
<i class="fa fa-fw fa-gift f22" ng-if="thisgrant.grant_type == 'Grant'"></i>
<i class="fa fa-fw fa-money f20" ng-if="thisgrant.grant_type == 'Loan'"></i>
<i class="fa fa-fw fa-life-ring f20" ng-if="thisgrant.grant_type == 'Other'"></i>
<i class="fa fa-fw fa-file-text-o f20" ng-if="thisgrant.grant_type == 'Contract'"></i>
<div class="rib" style="margin-left:2px; top:-1px;">
{{thisgrant.grant_type}} Opportunity
</div>
</div>
</div>
<?
if($phone)
{
?>
<br />
<?
}
if(!empty($grantDetails['image_url']))
{
if($grantDetails['image_width'] < $grantDetails['image_height'])
{
if($grantDetails['image_width'] > 100)
{
$imageSize = ' width="100px" ';
}
else
{
$imageSize = ' width="'.$grantDetails['image_width'].'px" ';
}
}
else
{
if($grantDetails['image_height'] > 50)
{
$imageSize = ' height="50px" ';
}
else
{
$imageSize = ' height="'.$grantDetails['image_height'].'px" ';
}
}
if($phone)
{
if($grantDetails['image_width'] > 280)
{
$imageSize = ' width="280px" ';
}
?>
<center>
<?
}
?>
<img ng-src="{{thisgrant.image_url}}" class="<?=$phone ? 'block' : 'fright'?>"
style="<?=$phone ? 'margin-top:10px;' : 'margin:-10px 20px 20px 20px;'?>" <?=$imageSize?>
ng-if="thisgrant.image_url != ''" />
<?
if($phone)
{
?>
</center>
<?
}
}
?>
<?
if(!$phone)
{
?>
<hr />
<?
}
?>
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="rb">
<div class="f24 bold <?=$phone ? 'cc pt10' : 'left green'?>"
ng-show="thisgrant.amount == 'Varies'">
Amount Varies
</div>
<div class="f24 bold <?=$phone ? 'cc pt10' : 'left green'?>"
ng-show="thisgrant.amount != 'Varies'">
{{thisgrant.amount | currency}}
</div>
</div>
<div class="rib <?=$phone ? 'cc' : 'left'?>">
<span class="f18 bold dark-gray"
ng-show="thisgrant.deadlineSpread == 'No Deadline'">
Open, Apply Anytime
</span>
<div class="rib" ng-show="thisgrant.deadlineSpread != 'No Deadline'">
<span class="f12 gray bold" ng-show="!phone">Deadline:</span>
<br ng-show="!phone" />
<div class="rb f16 gray bold" ng-show="phone" style="margin-top:8px; margin-bottom:-8px;">ENDS</div>
<span class="f18 bold dark-gray">{{thisgrant.deadline}}</span>
<div class="rb f12 gray <?=$phone ? 'cc' : 'left'?>">
{{thisgrant.deadlineSpread}} {{thisgrant.spread}} Remaining
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"></div>
</div>
</div>
</div>
<div class="rb">
<div class="left" ng-class="phone ? '' : 'pl20 pr20'">
<div class="f18 bold dark-gray">
Description
</div>
<p class="justify" ng-bind-html="thisgrant.description | trust"></p>
</div>
<div class="left" ng-class="phone ? '' : 'pl20 pr20'">
<div class="f18 bold dark-gray">
Requirements
</div>
<p class="justify" ng-bind-html="thisgrant.requirements | trust"></p>
</div>
<div class="rb p20 left">
<div class="rb f12 bold dark-gray">
<span ng-if="thisgrant.grant_type == 'Investor'">
Investment
</span>
<span ng-if="thisgrant.grant_type == 'Grant'">
Grant
</span>
<span ng-if="thisgrant.grant_type == 'Loan'">
Loan
</span>
<span ng-if="thisgrant.grant_type == 'Other'">
Other
</span>
<span ng-if="thisgrant.grant_type == 'Contract'">
Contract
</span>
Oppurtunity Provided By:
</div>
<div class="rb f18 bold dark-gray">
{{thisgrant.org_name}}
</div>
<div class="rb f12 bold dark-gray">
{{thisgrant.org_address}}
</div>
<div class="rb f12 bold dark-gray">
{{thisgrant.org_city}} {{thisgrant.org_state}}
</div>
<div class="rb f12 bold dark-gray">
{{thisgrant.org_zip}}
</div>
<div class="rb f14 bold dark-gray">
{{thisgrant.org_phone1}}
</div>
<div class="rb f14 bold bright-blue">
{{thisgrant.org_email}}
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pt20 center">
<div class="rib none noborder pointer"
style="left:0px; width:100px; padding:10px;"
ng-click="favorite(thisgrant)">
<div class="rib center-center gray">
<div class="rb" style="height:22px;"></div>
<span class="glyphicons favorite{{thisgrant.grants_id}} gray f28"
ng-class="thisgrant.favorite ? 'favoriteSelected glyphicons-heart' : 'favorite glyphicons-heart-empty'"></span>
<div class="rb f14 bold">
Favorite
</div>
</div>
<div class="rib center-center" style="width:0px; height:100%; margin-left:-3px;"></div>
</div>
<div class="rib none noborder pointer" ng-show="!thisgrant.url">
<div class="rib center-center" onclick="alert('This application is not available online, you need to call, mail, or email them to apply.');">
<span class="glyphicons glyphicons-invoice f50"></span>
<div class="rb f14 bold">
Apply Today
</div>
</div>
<div class="rib center-center" style="width:0px; height:100%; margin-left:-3px;"></div>
</div>
<a href="{{thisgrant.url}}" class="rib btn none noborder btn-lg center-center"
style="width:150px; right:0px; padding:10px;" target="_blank"
ng-click="applying(thisgrant);" ng-show="thisgrant.url">
<div class="rib center-center">
<span class="glyphicons glyphicons-invoice f50"></span>
<div class="rb f14 bold">
Apply Today
</div>
</div>
<div class="rib center-center" style="width:0px; height:100%; margin-left:-3px;"></div>
</a>
<div id="didApply" ng-show="thisgrant.did_apply == 'no' || thisgrant.did_apply == 'yes'" class="rib center-center"
style="height:96px; margin-right:10px; display:inline-block;">
<div class="cd">
<div class="rb f14 bold gray noselect">
Did you Apply?
<br />
<div id="yesApplied{{thisgrant.grants_id}}" class="yesApplied rb pt2 pointer" style="left:-4px;"
ng-click="didYouApply(thisgrant, 'yes')">
<div class="rib" style="width:32px;">Yes</div>
<div class="rib fa fa-fw f20"
ng-class="thisgrant.did_apply == 'yes' ? 'fa-dot-circle-o lred' : 'fa-circle-o'"
style="top:3px;"></div>
</div>
<div id="noApplied{{thisgrant.grants_id}}" class="noApplied rb pt2 pointer" style="left:-4px;"
ng-click="didYouApply(thisgrant, 'no')">
<div class="rib" style="width:32px;">No</div>
<div class="rib fa fa-fw f20"
ng-class="thisgrant.did_apply == 'no' ? 'fa-dot-circle-o lred' : 'fa-circle-o'"
style="top:3px;"></div>
</div>
</div>
</div>
<div class="cdl" style="width:0px; height:100%; margin-left:-3px;"></div>
</div>
<div class="rb cc">
<div id="appliedMenu{{thisgrant.grants_id}}" class="appliedMenu rib white-bg"
style="width:200px; height:auto;"
ng-if="thisgrant.amount == 'Varies'"
ng-show="thisgrant.did_apply == 'yes'">
<div class="rb p10">
<br />
<div class="pb10 f12 bold">
How much did you apply for?
</div>
<div class="rb">
<form id="amountApplied{{thisgrant.grants_id}}" name="amountApplied" method="post"
ng-submit="amountAppliedFor(thisgrant)"
enctype="multipart/form-data">
<input type="text" name="how_much" class="f16 bold" style="width:118px;" placeholder=""
ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" step="0.01"
ng-model="thisgrant.how_much_applied_for" required />
<button type="submit" class="btn btn-default" ng-disabled="amountApplied.how_much.$invalid || thisgrant.how_much_applied_for <= 0">
Save
</button>
<div class="saving" onclick="$(this).hide();">
<div class="cd">
<i class="fa fa-spinner fa-pulse fa-3x fa-fw lred f16"></i>
</div>
<div class="cdl"></div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="rb pt20">
<div class="f12 bold gray" ng-class="phone ? 'cc' : 'left'">
Funding Available To:
</div>
<div class="f12 bold dark-gray" ng-class="phone ? 'cc' : 'left'">
{{thisgrant.who}}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="rb pt20" ng-class="phone ? 'cc' : 'right'">
<div class="f12 bold gray" ng-show="phone" ng-class="phone ? 'cc' : 'right'">
{{thisgrant.only_available_gender+" "}}Residents: {{thisgrant.only_available_state}}
</div>
<div class="rib" ng-show="!phone">
<div class="f12 bold gray" ng-class="phone ? 'cc' : 'right'">
Open to {{thisgrant.only_available_gender+" "}}Residents of:
</div>
<div class="f12 bold dark-gray" ng-class="phone ? 'cc' : 'right'">
{{thisgrant.only_available_state}}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="rb" ng-show="!phone" style="height:32px;"></div>
<div class="rb pt10">
<table width="100%">
<tr>
<td ng-class="phone ? 'cc p10' : 'left'">
<div class="rib f12 bold dark-gray pr10" ng-if="thisgrant.subcategory_list"
ng-repeat="sub in thisgrant.subcategory_list">
{{ sub.name }}
</div>
</td>
<?
if($phone)
{
?>
</tr>
<tr>
<?
}
?>
<td ng-class="phone ? 'cc p10' : 'right'">
<div class="rib">
<div class="rib f12 bold gray rou blue" ng-class="phone ? 'rb' : 'rib'"
ng-click="reportBroken(thisgrant)">
<i class="fa fa-chain-broken f14"></i>Report Bad Link
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="rb" style="height:32px;" ng-show="phone"></div>
</div>
<?
/*
<div class="rb" ng-if="!userPreferences.monthlySubscription">
<div class="rb cc f16 bold p10 bred" style="margin-bottom:0px;">
**To view the "Grant Details" page, you must first upgrade your access**
</div>
<?
include($_SERVER['DOCUMENT_ROOT']."/vx/usa/layout/inc/subscription.php");
?>
</div>
*/
?>
</div>
<?
$title = $grantDetails['name']." : ".$siteName;
include($_SERVER['DOCUMENT_ROOT']."/vx/usa/layout/body.php");
?>