<?php 
$con=mysqli_connect("localhost","trendinf_app","ioRcsMM~OLto","trendinf_app");
// Check connection
if (mysqli_connect_errno())
{
	echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

define("ROOT", "https://app.trendinfotechs.com/admin");
define("SITE_URL", "https://app.trendinfotechs.com/admin");
define("FILE_PATH", realpath($_SERVER["DOCUMENT_ROOT"]));

function getFlyerDetails($flyer_id){
	global $con;
	
	$flyer=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM flyers WHERE id={$flyer_id}"));
	
	return $flyer;
}

function getCityDetails($city_id){
	global $con;
	
	$city=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM cities WHERE id={$city_id}"));
	
	return $city;
}

function getCategoryDetails($cat_id){
	global $con;
	
	$cate=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM categories WHERE id={$cat_id}"));
	
	return $cate;
}

function getUserDetails($user_id){
	global $con;
	
	$user=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM users WHERE id={$user_id}"));
	
	return $user;
}

function getSettings(){
	global $con;
	$setting=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM settings WHERE id=1"));
	return $setting;
}
?>