<div class="row g-2">
    <?php
    require '../../data.php';
    function timeindo($jamnya) {
        $hari = date("l", strtotime($jamnya));
    
        switch($hari){
            case 'Monday':
                return 'Senin';
            break;
    
            case 'Tuesday':
                return 'Selasa';
            break;
    
            case 'Wednesday':
                return 'Rabu';
            break;
    
            case 'Thursday':
                return 'Kamis';
            break;
    
            case 'Friday':
                return 'Jumat';
            break;
    
            case 'Saturday':
                return 'Sabtu';
            break;
    
            case 'Sunday':
                return 'Minggu';
            break;
        }
    
    }
    
    function monthindo($jamnya) {
        $hari = date("F", strtotime($jamnya));
    
        switch($hari){
            case 'January':
                return 'Januari';
            break;
    
            case 'February':
                return 'Februari';
            break;
    
            case 'March':
                return 'Maret';
            break;
    
            case 'April':
                return 'April';
            break;
    
            case 'May':
                return 'Mei';
            break;
    
            case 'June':
                return 'Juni';
            break;
    
            case 'July':
                return 'Juli';
            break;
    
            case 'August':
                return 'Agustus';
            break;
    
            case 'September':
                return 'September';
            break;
    
            case 'November':
                return 'November';
            break;
    
            case 'December':
                return 'Desember';
            break;
        }
    
    }
        $gpanduan = "SELECT * FROM panduan_post WHERE panduan_status = '1'";
        $qpanduan = mysqli_query($data, $gpanduan);
        $search = mysqli_real_escape_string($data, $_POST['panduan']);

        if(mysqli_num_rows($qpanduan) > 0) {
            while($fpanduan = mysqli_fetch_assoc($qpanduan)) {
                $title = $fpanduan['title_panduan'];
                $slug = $fpanduan['title_slug_panduan'];
                $desc = $fpanduan['short_dec_panduan'];
                $thumbnail = $fpanduan['thumbnail_panduan'];
                $tanggal = $fpanduan['tanggal_panduan'];


                if(stristr($title, $search) !== false) {
                    echo ' <div class="col-xl-4 mb-2">
                <div class="card card-posts">
                <a href="?page=bukti-jp-member&blog='.$slug.'"> <img src="'.$thumbnail.'" class="card-img-top" alt="'.$slug.'"></a>
                    <div class="card-body card-posts">
                        <h5 class="card-title">'.$title.'</h5>
                        <p class="card-text">'.$desc.'</p>
                        <p class="card-text"><small class="text-muted">Diupload Pada : '.timeindo($tanggal).', '.date("d", strtotime($tanggal)).' '.monthindo($tanggal).' '.date("Y", strtotime($tanggal)).'</small></p>
                            <div class="d-flex justify-content-end">
                                <a href="?page=bukti-jp-member&blog='.$slug.'" class="btn btn-warning"><i class="fas fa-info-circle"></i> Baca Selengkapnya</a>
                            </div>
                    </div>
                </div>
            </div>';
                }

            }
        }
    ?>

</div>