<?php

$iddetail = $_GET['iddetail'];

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


?>



<section id="services" class="services section-bg bg-white">
    <div class="container">

        <div class="section-title mt-5">
            <h2>Berita</h2>
            <p>Berita update terpecaya</p>
        </div>
        <div class="row">


            <div class="col-md-9">

                <div class="card mb-9">
                    <div class="card">
                        <img height="450" src="admin/dist/img/imgberita/<?= $datadetail['berita_foto']; ?>" alt="">
                        <i class="icofont-wall-clock mt-3 ml-3"> <small><?= $datadetail['berita_tgl'] ?></small></i>
                        <div class="card-body">

                            <p class="text-justify">
                                <?= $datadetail['berita_ket'] ?>
                            </p>

                        </div>
                    </div>
                </div>

            </div>
            <div class="col-md-3">
                <?php
                $databerita =  $koneksi->query("SELECT * FROM tbl_berita");
                foreach ($databerita as $pecah) :
                ?>


                    <div class="card mb-3">
                        <img height="200" white="200" src="admin/dist/img/imgberita/<?= $pecah['berita_foto'] ?>" class="card-img-top" alt="...">
                        <div class="card-body">
                            <h5 class="card-title"><?= $pecah['berita_nama'] ?></h5>
                            <p class="card-text"><small class="text-muted"><?= $pecah['berita_tgl'] ?></small></p>
                            <a style="color: green;" href="?page=pages/berita/detail_berita&iddetail=<?= $pecah['berita_id'] ?>">Baca</a>
                        </div>

                    </div>


                <?php
                endforeach;
                ?>

            </div>


        </div>
    </div>
</section><!-- End Services Section -->