<?php require view('theme/header'); ?>

<?php if(session('user_id')): ?>
<?php else: ?>
<style>.app-main{padding-top: 125px}</style>
<?php endif; ?>

<main class="app-main">
    <div class="page-content">

<?php if(session('user_id')): ?>
<div class="container-fluid">
<?php else: ?>
<div class="container">
<?php endif; ?>

<div class="hp-bbox mt-5 mb-5">
                <div class="row">
                    <div class="col-lg-6">
                        <div class="hpbb-body">
                            <h2 class="hp-title">Blog</h2>
                            <p class="hpbb-text">
								Para yatırmadan önce hüküm ve koşullarımızı okuduğunuzdan emin olun.<br /> 
								Bonusları olan ödeme yöntemlerini kullanmayı öneririz.
							</p>
                        </div>
                    </div>
                </div>
            </div>
<?php if(!route(1)): ?>
			<?php foreach ($blogs as $row): ?>
			<div class="card mb-3">
				<div class="card-afip-body">
					<h4><?= $row['blog_title'] ?></h4>
					<div class="blog-txt"><?= substr(htmlspecialchars_decode($row['blog_content']), 0, 250) . "..."; ?></div>
					<a href="<?= site($siteLinks['blog']['url'] . '/' . $row['blog_url']) ?>" class="btn btn-primary">Devamını Oku</a>
				</div>
			</div>
			<?php endforeach; ?>
<?php else: ?>
			<div class="card">
				<div class="card-afip-body">
					 
					<h1><?=$title?></h1>
					<div><?= htmlspecialchars_decode($blog_content) ?></div>
				</div>
			</div>

			<a href="/blog" class="btn btn-primary mt-3">Geri Dön</a>
<?php endif; ?>
</div>
</main>

<?php require view('theme/footer'); ?>
