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/newusafunding.com/vx/usa/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/usa_sites/newusafunding.com/vx/usa/functions/searchFetch.php
<?
include_once($_SERVER['DOCUMENT_ROOT']."/vx/lib/xinc.php");
include_once($_SERVER['DOCUMENT_ROOT']."/vx/usa/lib/formalizeGrants.php");
if(empty($user) || $guest)
{
	return false;
	exit;	
}
else
{
	$category = $_POST['category'];
	$state = $_POST['state'];
	$filter = $_POST['keyword'];
	
	for($i = 0; $i < count($states); $i++)
	{
		if($states[$i]['state'] == $state)
		{
			$state = $states[$i]['state_short'];
		}
	}
	 
	if(strlen($filter) > 4 || !empty($state) || !empty($category))
	{
		$filterQuery = "";
		$stateQuery = "";
		if(!empty($filter))
		{
			$filterQuery = " gg.name LIKE '%$filter%' OR gg.description LIKE '%$filter%' ";
		}
		if(!empty($state))
		{
			if(!empty($filter))
			{
				$stateQuery = " OR gg.only_available_state LIKE '%$state%' ";
			}
			else
			{
				$stateQuery = " gg.only_available_state LIKE '%$state%' ";
			}
		}
		if(!empty($category))
		{
			if(!empty($filter) || !empty($state))
			{
				$categoryQuery = " OR gs.name LIKE '%$category%' ";
			}
			else
			{
				$categoryQuery = " gs.name LIKE '%$category%' ";
			}
		}
		$grantList = $db->query("
									SELECT 
											gg.*,
											gusg.id AS favorite
									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_subcategories AS ggs
										ON gg.grants_id = ggs.grants_id
									LEFT JOIN grdb.grd_subcategories AS gs
										ON ggs.subcategories_id = gs.subcategories_id	
									LEFT JOIN grdb.grd_usa_saved_grants AS gusg
										ON 
											gusg.grants_id = gg.grants_id
										AND 
											gusg.client_id = '$user'
										AND 
											site_code = '$siteCode'
									WHERE
											ggc.categories_id = $siteCategory
										AND
										(
												gg.deadline > NOW()
											OR
												gg.deadline = '0000-00-00'
										)
										AND
											gg.name <> ''
										AND
											gg.name IS NOT NULL
										AND
											(
												$filterQuery	
												$stateQuery	
												$categoryQuery											
											)
										AND gg.status='active'
									GROUP BY gg.grants_id
									ORDER BY gg.deadline ASC, gg.amount DESC
								");
		$grantList = array_slice($grantList, 0, 300);
	}
	if(count($grantList) > 0)
	{
		$grantList = formalizeGrants($grantList, $userDB, $states, $db);
	}
	else
	{
		$grantList = "No Results";
	}
	$data['grants'] = $grantList;
	$data['filter'] = $filter;
	$data['state'] = $state;
	
	echo json_encode($data);	
}
?>


























Youez - 2016 - github.com/yon3zu
LinuXploit