<div class="content">
    <div class="container">
        <?php
        if ($_GET['sil']) {
            $idd = $_GET['sil'];
            $sekil_sorgu = $db->query("select * from elaqegelen where id='$idd'")->fetch(PDO::FETCH_ASSOC);
            unlink('../imgupload/' . $sekil_sorgu['resim']);
            $indi = $db->query("delete from elaqegelen where id='$idd'")->fetch(PDO::FETCH_ASSOC);
        }
        ?>
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">Əlaqə formundan gələnlər</h3>
                    </div>
                    <div class="panel-body">
                        <table id="datatable-buttons" class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Ad Soyad</th>
                                    <th>Mövzu</th>
                                    <th>Telefonu</th>
                                    <th>Xidməti</th>
                                    <th>Gmailı</th>
                                    <th>Sahə 1</th>
                                    <th>Sahə 2</th>
                                    <th>Sahə 2</th>
                                    <th>Sahə 2</th>
                                    <th>Mesajı</th>
                                    <th>Tarixi</th>
                                    <th>Ipisi</th>
                                    <th>Əməliyyat</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $cek = $db->query("select * from elaqegelen order by id desc")->fetchAll(PDO::FETCH_ASSOC);
                                foreach ($cek as $goster) {
                                ?>
                                    <tr>
                                        <td><?= $goster["id"] ?></td>
                                        <td><?= $goster["adsoyad"] ?></td>
                                        <td><?= $goster["konu"] ?></td>
                                        <td><?= $goster["telefon"] ?></td>
                                        <td><?= $goster["hizmet"] ?></td>
                                        <td><?= $goster["email"] ?></td>
                                        <td><?= $goster["sahebir"] ?></td>
                                        <td><?= $goster["saheiki"] ?></td>
                                        <td><?= $goster["saheuc"] ?></td>
                                        <td><?= $goster["sahedort"] ?></td>
                                        <td><?= $goster["mesaj"] ?></td>
                                        <td><?= $goster["tarih"] ?></td>
                                        <td><?= $goster["ip"] ?></td>
                                        <td>
                                            <div class="btn-group">
                                                <a href="?sil=<?= $goster["id"] ?>" class="btn btn-default waves-effect">Sil</a>
                                            </div>
                                        </td>
                                    </tr>
                                <?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>