<?php

$iddetail = $_GET['iddetail'];

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


?>



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

        <div class="section-title mt-5">
            <h2>Artikel</h2>
            <p>Artikel yang Ada di Smk 2 guguak</p>
        </div>
        <div class="row">


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

                <div class="card mb-9">
                    <div class="card">
                        <div class="card-header" style="background-color: white;">
                            <h2><b><?= $datadetail['artikel_nama'] ?></b></h2>
                        </div>
                        <img height="450" src="admin/dist/img/imgartikel/<?= $datadetail['artikel_foto']; ?>" alt="">
                        <i class="icofont-wall-clock mt-2 ml-4"> <small><?= $datadetail['artikel_tgl'] ?></small></i>
                        <div class="card-body ml-4" style="background-color: white;">
                            <p class="text-justify">
                                <?= $datadetail['artikel_ket'] ?>
                            </p>

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

            </div>
            <div class="col-md-3" style="background-color: white;">
                <?php
                $dataartikel =  $koneksi->query("SELECT * FROM tbl_artikel");
                foreach ($dataartikel as $pecah) :
                ?>


                    <div class="card mb-3" style="background-color: white;">
                        <img height="200" white="200" src="admin/dist/img/imgartikel/<?= $pecah['artikel_foto'] ?>" class="card-img-top" alt="...">
                        <div class="card-body">
                            <h5 class="card-title"><?= $pecah['artikel_nama'] ?></h5>
                            <i class="icofont-wall-clock"> <small><?= $datadetail['artikel_tgl'] ?></small></i>
                            <p class="card-text"><small class="text-muted">
                                    <!-- <p><?= substr($pecah['artikel_ket'], 0, 100) ?></p> -->
                                </small></p>
                            <a style="background-color: #5fcf80;" href="?page=pages/artikel/detail&iddetail=<?= $pecah['artikel_id'] ?>">Baca..</a>
                        </div>

                    </div>


                <?php
                endforeach;
                ?>

            </div>


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