<?php 
require_once $_SERVER['DOCUMENT_ROOT'].'/admin/system/settings/db.php';
?>
<?php $aranan = $_POST['aranan']; ?>
<?php $total ='0'; ?>
<?php $page = intval(@$_GET['page']);
if (!$page) {
$page = 1;
}
$bak = $DB->prepare("select * from members");
$bak->execute(array());
$toplam= $bak->rowCount();
$limit = 10;
$goster = $page*$limit-$limit;
$sayfasayisi = ceil($toplam/$limit);
$forlimit = 1; ?>
<?php $members = $DB->query("SELECT * from members where name like '%$aranan%' order by id desc limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); 
foreach ($members as $membersCek) {
?>
<tr class="odd">
    <td class=" control" tabindex="0" style="display: none;"></td>
    <td class="sorting_1">
        <a class="fw-bold">#<?=$membersCek['id']?></a>
    </td>

    <td>
        <div class="d-flex justify-content-left align-items-center">
            <div class="d-flex flex-column">
                <h6 class="user-name text-truncate mb-0">
                    <?=$membersCek['name']?></h6>
            </div>
        </div>
    </td>
    <td>
        <?=$membersCek['phone']?>
    </td>
    <td>
        <?=$membersCek['email']?> 
    </td>
    <td>
        <div class="d-flex align-items-center col-actions">
            <a class="me-25" href="members/<?=$membersCek['id']?>" data-bs-toggle="tooltip" data-bs-placement="top"
                title="" data-bs-original-title="Üye Düzenle" aria-label="Üye Düzenle">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                    stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                    class="feather feather-eye font-medium-2 text-body">
                    <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
                    <circle cx="12" cy="12" r="3"></circle>
                </svg>
            </a>
            <a class="me-25" href="member-appointment/<?=$membersCek['id']?>"
            data-bs-toggle="tooltip" data-bs-placement="top" title=""
            data-bs-original-title="Müşteri Randevuları"
            aria-label="Müşteri Randevuları">
            <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
        </a>

        <a class="me-25" href="member-note/<?=$membersCek['id']?>"
            data-bs-toggle="tooltip" data-bs-placement="top" title=""
            data-bs-original-title="Müşteri Notları"
            aria-label="Müşteri Notları">
           <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-send"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
        </a>
        
        <a class="me-25" href="member-sales/<?=$membersCek['id']?>"
            data-bs-toggle="tooltip" data-bs-placement="top" title=""
            data-bs-original-title="Müşteri Siparişleri"
            aria-label="Müşteri Siparişleri">
            <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>
        </a>
        <a class="me-25" href="case-add?type=1&musteri=<?=$membersCek['id']?>"
            data-bs-toggle="tooltip" data-bs-placement="top" title=""
            data-bs-original-title="Gelir Ekle"
            aria-label="Gelir Ekle">
            <svg style="width: 2rem;height: 2rem;" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="green" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down-right"><line x1="7" y1="7" x2="17" y2="17"></line><polyline points="17 7 17 17 7 17"></polyline></svg>                                               
        </a>
            <a class="uyeSil" membersID="<?=$membersCek['id']?>" style="margin-left:20px" class="me-25"
                data-bs-toggle="tooltip" data-bs-placement="top" title="" data-bs-original-title="Üye Sil"
                aria-label="Üye Sil">
                <svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="none"
                    stroke="red" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                    class="feather feather-trash-2">
                    <polyline points="3 6 5 6 21 6"></polyline>
                    <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
                    </path>
                    <line x1="10" y1="11" x2="10" y2="17"></line>
                    <line x1="14" y1="11" x2="14" y2="17"></line>
                </svg>
            </a>
        </div>
    </td>
</tr>
<?php } ?>