<?php

$iddetail = $_GET['iddetail'];

$datadetail = $koneksi->query("SELECT * FROM tbl_berita WHERE berita_id ='$iddetail'")->fetch_assoc();


?>

<section id="blog" class="blog">
    <div class="container mt-5">
        <div class="section-title">
            <h2>Berita</h2>
            <p>Berita</p>
        </div>
        <div class="row">


            <div class="col-lg-8 entries">

                <article class="entry entry-single">

                    <div class="entry-img">
                        <img width="800" src="admin/dist/img/imgberita/<?= $datadetail['berita_foto']; ?>" alt="" class="img-fluid">
                    </div>

                    <h2 class="entry-title">
                        <p><?= $datadetail['berita_nama'] ?></p>
                    </h2>

                    <div class="entry-content">
                        <p>
                            <?= $datadetail['berita_ket'] ?>
                        </p>



                    </div>

                    <div class="entry-footer clearfix">
                        <div class="float-left">
                        </div>

                        <div class="float-left share">
                            <a href="#" title="Share on Twitter"><i class="icofont-twitter"></i></a>
                            <a href="#" title="Share on Facebook"><i class="icofont-facebook"></i></a>
                            <a href="#" title="Share on Instagram"><i class="icofont-instagram"></i></a>
                        </div>

                    </div>

                </article><!-- End blog entry -->

                <!-- End blog author bio -->

                <!-- End blog comments -->

            </div><!-- End blog entries list -->

            <div class="col-lg-4">

                <div class="sidebar">

                    <h3 class="sidebar-title">Search</h3>
                    <div class="sidebar-item search-form">
                        <form action="">
                            <input type="text">
                            <button type="submit"><i class="icofont-search"></i></button>
                        </form>

                    </div><!-- End sidebar search formn-->

                    <h3 class="sidebar-title">Kategori Berita</h3>
                    <div class="sidebar-item categories">
                        <?php
                        $data =  $koneksi->query("SELECT * FROM tbl_kategori");
                        foreach ($data as $pecah) :

                        ?>
                            <ul>
                                <li><a href="?page=pages/berita/berita_perkategori&idkategori=<?= $pecah['kategori_id'] ?>"><?= $pecah['kategori_nama'] ?></a></li>
                            </ul>
                        <?php
                        endforeach;
                        ?>

                    </div><!-- End sidebar categories-->

                    <h3 class="sidebar-title">Berita</h3>
                    <div class="sidebar-item recent-posts">
                        <?php

                        $databerita = $koneksi->query("SELECT * FROM tbl_berita WHERE kategori_id");
                        foreach ($databerita as $pecah) :

                        ?>
                            <div class="post-item clearfix">
                                <img src="admin/dist/img/imgberita/<?= $pecah['berita_foto'] ?>" alt="">

                                <h4>
                                    <a href="?page=pages/berita/detail_berita&iddetail=<?= $pecah['berita_id'] ?>">
                                        <?= $pecah['berita_nama'] ?>
                                    </a>
                                </h4><br><br>
                                <span class=""><?= $pecah['berita_tgl'] ?></span><br>
                                <!-- <p style="background: #5fcf80; text-align: center;"><a href="?page=pages/berita/detail_berita&iddetail=<?= $pecah['berita_id'] ?>">Read More...</a></br> -->
                            </div>
                        <?php
                        endforeach;
                        ?>
                    </div><!-- End sidebar recent posts-->
                    <!-- End sidebar tags-->

                </div><!-- End sidebar -->

            </div><!-- End blog sidebar -->

        </div>

    </div>
</section>

<!-- End Services Section -->