<?php include 'inc/header.php';?>
<?php include 'inc/sidebar.php';?>
<?php include 'inc/navbar.php';?>

            <!-- Page Content-->
            <div class="page-content">
                <div class="container-fluid">
                    <!-- Page-Title -->
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="page-title-box">
                                <div class="row">
                                    <div class="col">
                                        <h4 class="page-title">Instagram Listesi</h4>
                                        <ol class="breadcrumb">
                                            <li class="breadcrumb-item"><a href="anasayfa">Anasayfa</a></li> 
                                            <li class="breadcrumb-item active">Instagram Listesi</li>
                                        </ol>
                                    </div><!--end col--> 
                                </div><!--end row-->                                                              
                            </div><!--end page-title-box-->
                        </div><!--end col-->
                    </div><!--end row-->
                    <!-- end page title end breadcrumb -->
                                <style type="text/css">
                                    i { 
                                        font-size: 16px;
                                    }
                                </style>
                    <div class="row"> 
                        <div class="col-lg-12">
                            <div class="card">
                                <div class="card-header">
                                    <h4 class="card-title">Instagram Listesi</h4>
                                    <p class="text-muted mb-0">Değerli kullanıcı, instagram botu sayesinde hesabınızda paylaştığınız tüm içerikleri burada bulabilirsiniz.
                                    </p>
                                </div><!--end card-header-->
                                <div class="card-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered mb-0 table-centered">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Foto</th>
                                                <th>Bağlantı</th> 
                                                <th>Tarih</th>                                                 
                                                <th>İşlemler</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                                <?php
                                            $ebultensorgu = $dbh->prepare("SELECT * FROM urunler_insta ");
                                            $ebultensorgu->execute();

                                            while ($ebultensonuc = $ebultensorgu->fetch()) {

                                            $id = $ebultensonuc['id'];
                                            $resim = $ebultensonuc['resim']; 
                                            $zaman = $ebultensonuc['zaman']; 
                                            $link = $ebultensonuc['link']; 
                                            $zaman = $ebultensonuc['zaman'];
                                            $phpdate = strtotime( $zaman );
                                            $mysqldate = date( 'd-m-Y ', $phpdate );
                                            $baslikseo=seo( $ebultensonuc['services_name']);
                                            ?>
                                            <tr>
                                                <td style="width: 10px; height: 10px;">#<?=$ebultensonuc['id'];?></td>
                                                <td><img src="../img/urunler/<?=$ebultensonuc['resim'];?>"></td>
                                                <td><a href="<?=$ebultensonuc['link'];?>" target="_blank"> Bağlantıyı Gör </a></td> 
                                                <td><?=$mysqldate?></td>
                                               <td style="width: 150px; ">
                                       
                                        <button type="button" class="btn btn-outline-danger btn-icon-circle-sm" data-toggle="modal" data-target="#exampleModalDanger<?=$ebultensonuc['id'];?>" ><i class="ti-trash"></i></button> 

                                            </td> 
                                            </tr>

                                             
                                           
                                            <!-- silme başlangıçı -->

                                            <div class="modal fade" id="exampleModalDanger<?=$ebultensonuc['id'];?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalDanger<?=$ebultensonuc['id'];?>" aria-hidden="true">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header bg-danger">
                                                    <h6 class="modal-title m-0 text-white" id="exampleModalDanger<?=$ebultensonuc['id'];?>"><?=$ebultensonuc['title'];?></h6>
                                                    <button type="button" class="close " data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true"><i class="la la-times text-white"></i></span>
                                                    </button>
                                                </div><!--end modal-header-->
                                                <div class="modal-body">
                                                    <div class="row"> 
                                                        <div class="col-lg-12">
                                                            <h5>Bu veriyi silmek istiyormusunuz ?</h5>
                                                            <span class="badge bg-soft-secondary">Eklenme Tarihi:</span>
                                                            <small class="text-muted ml-2"> <?=$mysqldate?></small>
                                                            <ul class="mt-3 mb-0">
                                                                <li>Bu veri silinirse geri döndürülemez.</li> 
                                                            </ul>
                                                        </div><!--end col-->
                                                    </div><!--end row-->                                                     
                                                </div><!--end modal-body-->
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Kapat</button>
                                                  <a href="islem.php?id=<?=$ebultensonuc['id']; ?>&islem=instagram-sil"><button type="button" class="btn btn-danger btn-sm">Evet, Sil</button></a>
                                                </div><!--end modal-footer-->
                                            </div><!--end modal-content-->
                                        </div><!--end modal-dialog-->
                                    </div><!--end modal-->
                                             <?php } ?>
                                            
                                             
                                            </tbody>
                                        </table><!--end /table-->
                                    </div><!--end /tableresponsive-->
                                </div><!--end card-body-->
                            </div><!--end card-->
                        </div> <!-- end col -->
                    </div> <!-- end row -->
    
       

                </div><!-- container -->

<?php include 'inc/footer.php';?>