<div class="page-banner">
    <?php if ($project['cover_image'] != '') { ?>
        <img src="<?php echo base_url($project['cover_image']); ?>" class="w-100" alt="jiwa img">
    <?php } else { ?>
        <!-- <img src="<?php //echo base_url(); 
                        ?>assets/user/img/jiwa-banner.webp" class="w-100" alt="jiwa img"> -->
    <?php } ?>
    <div class="page-text">
        <h1 class="heading2"><?php echo $project['title']; ?></h1>
        <ul class="d-flex justify-content-center list-unstyled">
            <li><a href="<?php echo base_url(); ?>">HOME</a></li>
            <li>></li>
            <li>PORTFOLIO</li>
        </ul>
        <div class="line"></div>
    </div>
</div>
<div class="gallery">
    <div class="container">
        <div class="row justify-content-center mb-3 mb-sm-5">
            <div class="col-lg-8 col-md-10">
                <!-- <h4 class="esmond-title text-center">Designed with a theme of a Javanese concept, with landscape depicting the traditional java landscape with majority of the plants selected found in Java to compliment the wood carving and materials from Java.</h4> -->
                <?php echo $project['description']; ?>
            </div>
        </div>
        <?php $cname = $this->common->getsData('gallery_category', array('id' => $project['category']), 'category'); ?>
        <div class="row g-sm-0 g-4 py-3">
            <hr class="d-none d-sm-block">
            <div class="col-sm-4">
                <div class="gallery-text text-sm-center">
                    <div class="d-inline-block text-start">
                        <h5 class="gallery-title">Project Type</h5>
                        <p><?php echo (isset($cname['category'])) ? $cname['category'] : ''; ?></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="gallery-text year-border text-sm-center">
                    <div class="d-inline-block text-start">
                        <h5 class="gallery-title">Year Completed</h5>
                        <p><?php echo $project['completed_date']; ?></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="gallery-text text-sm-center">
                    <div class="d-inline-block text-start">
                        <h5 class="gallery-title">Designer</h5>
                        <p><?php echo $project['designer']; ?></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row g-3 mb-5">
            <div class="col-12">
                <div class="grid">
                    <div class="grid-sizer"></div>
                    <?php if (isset($gallery) && $gallery) {
                        foreach ($gallery as $key => $value) { ?>
                            <div class="grid-item">
                                <div class="gallery-img text-center">
                                    <img src="<?php echo base_url($value['image']); ?>" class="w-100" alt="house1 img">
                                </div>
                            </div>
                    <?php }
                    } ?>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
                <?php $prev = $this->db->query('SELECT projectid,title FROM gallery_project WHERE id < ' . $project['id'] . ' ORDER BY id desc LIMIT 0,1 ')->result_array(); ?>
                <?php $next = $this->db->query('SELECT projectid,title FROM gallery_project WHERE id > ' . $project['id'] . ' ORDER BY id ASC LIMIT 0,1 ')->result_array(); ?>
                <ul class="back-btns d-flex justify-content-between list-unstyled mb-0">
                    <li>
                        <?php if (isset($prev[0]['projectid']) && $prev[0]['projectid'] != '') {
                            $prev = $prev[0];
                        ?>
                            <a href="<?php echo base_url('portfolio-detail/' . url_title(strtolower($prev['title'])) . '/' . $prev['projectid']); ?>">
                                < Previous Project</a>
                                <?php } ?>
                    </li>
                    <li><a href="<?php echo base_url(); ?>portfolio">Back to All Projects</a></li>
                    <li>
                        <?php if (isset($next[0]['projectid']) && $next[0]['projectid'] != '') {
                            $next = $next[0];
                        ?>
                            <a href="<?php echo base_url('portfolio-detail/' . url_title(strtolower($next['title'])) . '/' . $next['projectid']); ?>">Next Project ></a>
                        <?php } ?>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>