<?= $this->extend('Modules\Admin\Views\index'); ?>
<?= $this->section('content');?>
<div class="container-fluid">
<div class="row mb-md-3">
	<div class="col">
		<h4>Edit Page</h4>
		<!-- Breadcrumb !-->
		<nav aria-label="breadcrumb"><small>
			<ol class="breadcrumb mb-0">
				<li class="breadcrumb-item"><a href="<?= base_url('administrator') ?> ">Home</a></li>
                <li class="breadcrumb-item"><a href="<?= base_url('administrator/pages') ?> ">All Pages</a></li>
				<li class="breadcrumb-item active" aria-current="page"><?= esc($bcrumb) ?> </li>
			</ol></small>
		</nav>
		<!-- End Breadcrumb !-->
	</div>
</div>
<!-- print success message !-->
<div class="row">
    <div class="col">
		<!-- print success message !-->
		<?php if(session()->getTempdata('success')): ?>
			<div class="alert alert-success" role="alert"><?= session()->getTempdata('success');?></div>
		<?php endif;?>
		<!-- print failure message !-->
		<?php if(session()->getTempdata('error')): ?>
			<div class="alert alert-danger" role="alert"><?= session()->getTempdata('error');?></div>
		<?php endif;?>
        <?php if(isset($validation)): ?>
			<div class="alert alert-danger">
		<?= $validation->listErrors()?>
		</div>
        <?php endif;?>
        <div id="showMsg"></div>
</div></div>
<!-- Create/Post !-->
<div class="row">
    <div class="col-lg-10 col-md-10 col-sm-10">
        <div class="card card-body">
            <h4 class="fw-bold"><?= $singlePage->title; ?></h4>
            <span class="d-flex"><small><strong>Date:</strong> <?= date('jS M Y', strtotime($singlePage->created_at)); ?> | <strong>Author:</strong> <?= $singlePage->first_name; ?>  | <strong>Category:</strong> <?= $singlePage->category_name; ?></small></span>
			<hr/>
			<small><strong>Page Link:</strong> <span class="text-danger"><?= base_url().$singlePage->menu_link; ?></span> </small>
            <hr/>
			<p><img src="<?= $singlePage->photo; ?>" alt="<?= $singlePage->title; ?>" class="img-fluid" /></p>
            <?= $singlePage->content ?>

        </div>
    </div>
    <div class="col-lg-2 col-md-2 col-sm-2">
        <a href="<?= base_url('administrator/pages'); ?>" class="btn btn-sm btn-secondary mb-3 w-100">Back to Pages</a>
        <a href="<?= base_url('administrator/pages/edit/').$singlePage->id.'-'.$singlePage->alias; ?>" class="btn btn-sm btn-info mb-3 w-100">Edit Page</a>
        <a href="<?= base_url('administrator/pages/add/'); ?>" class="btn btn-sm btn-primary mb-3 w-100">Add New Page</a>

    </div>
</div>

<!-- End Create/Post !-->
<!---- JS --->
<script src="<?= base_url();?>/assets/js/modules/posts.js"></script>  
<?= $this->endSection();?>