<?php 
include('root/config.php');
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title><?php echo $ai_core->aiGetValue(DB_PREFIX."setting","description","id",'5');?></title>
	
	<meta name="keywords" content="<?php echo $ai_core->aiGetValue(DB_PREFIX."setting","description","id",'11');?>">
	<meta name="description" content="<?php echo $ai_core->aiGetValue(DB_PREFIX."setting","description","id",'17');?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="icon" href="img/favicon.jpg">
	<link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,700,900" rel="stylesheet">
	<link rel="stylesheet" href="css/core.css">
	<link rel="stylesheet" href="css/theme.css">
</head>
<body class="sticky-header sticky-footer">

	<!-- Preloader -->
	<div id="preloader"></div>
	
	<!-- Header -->
	<header id="header">

		<!-- Logo -->
		<a href="<?php echo SITE_URL; ?>Home" class="logo">
			<img src="logo.png" class="logo-light" alt="">
			<img src="logo.png" class="logo-dark" alt="">
		</a>

		<!-- Mobile Menu Icon -->
		<a href="#" class="mob-menu">
			<span></span><span></span><span></span>
		</a>

		<!-- Navigation -->
		<?php
		include('menu.php');
		?>
		<!-- /Navigation -->

	</header>
	<!-- /Header -->

	<!-- Main Content -->
	<main id="main">
		
		<!-- Hero -->
		<section class="flex-center background-parallax bg-dark py-14" data-background="img/gallery/21.jpg" data-overlay="black; .8">
			<div class="page-title-wrapper text-light">
				<h1 class="page-title">Blogs</h1>
			</div>
		</section>
		<!-- /Hero -->

		<!-- Blog Section -->
		<section class="bg-light pb-6">
			<div class="container py-8">
				<div class="row justify-content-center">
					<div class="col-9">
						
						<!-- Blog -->
						<div class="blog classic">
<?php
$imageUrl = "upload/blog/";
$qry = "SELECT * FROM ".DB_PREFIX."blog WHERE status='active' ORDER BY id DESC";
$result = $ai_db->aiGetQueryObj($qry);
if (COUNT($result) > 0) {
foreach ($result as $row) {
?>							
							<!-- Blog Item -->
							<article>
								<a href="#">
									<img src="<?php echo $imageUrl.$row->image; ?>" alt="">
								</a>
								<div class="details">
									<h5 class="bold uppercase">
										<a href="#"><?php echo $row->title; ?></a>
									</h5>
									<div class="serif small">
										<span><?php echo date('F d, Y',strtotime($row->created_at)); ?></span>
									</div>
									<?php echo $fse = strlen($row->description);?>
									<p style="margin-top:10px;"><?php 
									 if($fse <= 200)
									 {
									 	echo $row->description;
									 }
									 else
									 {
										echo substr($row->description,0,200).".......";
									 }
									?></p>
									
									<br><a class="button style-5 uppercase" href="<?php echo SITE_URL; ?>Blog-Detail/<?php echo $row->title_slug; ?>">Read More<a>
								</div>
							</article>
<?php } }else
{
	echo '<h3>No Blog Found...</h3>';
}?>							

						</div>
						<!-- /Blog -->

					</div>
				</div>
			</div>
		</section>
		<!-- /Blog Section -->

	</main>
	<!-- /Main Content -->

	<!-- Footer -->
	<?php include('footer.php'); ?>
	<!-- /Footer -->

	<!-- JS -->
	<script src="js/core.js"></script>
	<script src="js/theme.js"></script>
</body>

</html>