<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-header">
                <h4 class="card-title mb-0"><?=lang('page_title_languages', [], 'Diller')?> </h4>
            </div><!-- end card header -->

            <div class="card-body">
                <div class="listjs-table" id="customerList">
                    <div class="row g-4 mb-3">
                        <div class="col-sm-auto">
                            <div>
                                <a href="<?=ADMIN_URL?>/languages/create" class="btn btn-success add-btn"><i class="ri-add-line align-bottom me-1"></i><?=lang('create')?></a>
<!--                                <button class="btn btn-soft-danger deleted" data-link="--><?php //=ADMIN_URL?><!--/languages/delete/"-->
<!--                                        data-title="--><?php //=remove_title?><!--" data-question="--><?php //=remove_desc?><!--" data-no="--><?php //=no?><!--"  data-yes="--><?php //=yes?><!--"-->
<!--                                        onclick="deleteMultiple(this)"><i class="ri-delete-bin-2-line"></i></button>-->
                            </div>
                        </div>
                        <div class="col-sm">
                            <div class="d-flex justify-content-sm-end">
                                <div class="search-box ms-2">
                                    <input type="text" class="form-control search" placeholder="<?=lang('table_search')?>">
                                    <i class="ri-search-line search-icon"></i>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive table-card mt-3 mb-1">
                        <?php   if (languages('total_count') != 0 ){ ?>

                            <table class="table align-middle table-nowrap" id="customerTable" style="display:<?php if (!languages('data')): ?> none <?php endif; ?>">
                            <thead class="table-light">
                            <tr>
                                <th scope="col" style="width: 50px;">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="checkAll" value="option">
                                    </div>
                                </th>
                                <th class="sort" data-sort="lang_name"><?=lang('table_title_lang', [], 'Dil')?></th>
                                <th class="sort" data-sort="flags" style="width: 200px;"><?=lang('table_flag_lang', [], 'Bayrak')?></th>
                                <th class="sort" data-sort="is_default" style="width: 200px;"><?=lang('table_is_default', [], 'Varsayılan Dil')?></th>
                                <th class="sort" data-sort="action" style="width: 130px;"><?=lang('table_actions', [], 'İşlemler')?></th>
                            </tr>
                            </thead>
                            <tbody class="list form-check-all">
                            <?php
                                foreach (languages('data') as  $language){
                                    if ($language['lang_is_default']):
                                        $is_default= lang('yes');
                                    else:
                                        $is_default= lang('no');
                                    endif;
                            ?>
                            <tr>
                                <th scope="row">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" name="chk_child" value="option1">
                                    </div>
                                </th>
                                <td class="lang_name"><?=$language['lang_name']?></td>
                                <td class="flags"><img src="<?= ADMIN_FOLDER ?>/model/languages/flags/<?= $language['lang_code'] ?>.svg"></td>
                                <td class="is_default"><?= $is_default ?></td>
                                <td>
                                    <div class="d-flex gap-2">
                                        <div class="edit">
                                            <a href="<?=ADMIN_URL?>/languages/edit/<?=$language['lang_id']?>" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="<?=lang('edit')?>">
                                                <i class="bx bx-edit edit_icon" style=""></i>
                                            </a>
                                        </div>
                                        <div class="remove">
                                            <a href="<?=ADMIN_URL?>/languages/delete/<?=$language['lang_id']?>" class="delete" data-title="<?=lang('remove_title')?>" data-question="<?=lang('remove_desc')?>" data-no="<?=lang('no')?>"  data-yes="<?=lang('yes')?>" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="<?=lang('remove')?>">
                                                <i class="bx bx-trash trash_icon" style=""></i>
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php } ?>
                            </tbody>
                        </table>

                        <div class="noresult" style="display:<?php if (languages('data')): ?> none <?php else: ?> block <?php endif; ?>">
                            <div class="text-center">
                                <lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop" colors="primary:#121331,secondary:#08a88a" style="width:75px;height:75px"></lord-icon>
                                <h5 class="mt-2"><?=lang('table_noresult_title')?></h5>
                                <p class="text-muted mb-0"><?=lang('table_noresult_desc')?></p>
                            </div>
                        </div>
                        <?php
                        }else{
                        ?>
                        <div  style="display: block">
                            <div class="text-center">
                                <lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop" colors="primary:#121331,secondary:#08a88a" style="width:75px;height:75px"></lord-icon>
                                <h5 class="mt-2"><?=lang('table_noresult_title')?></h5>
                                <p class="text-muted mb-0"><?=lang('table_noresult_desc')?></p>
                            </div>
                        </div>
                        <?php } ?>
                    </div>

                    <div class="d-flex justify-content-end">
                        <div class="pagination-wrap hstack gap-2">
                            <a class="page-item pagination-prev disabled" href="javascrpit:void(0);">
                                <?=lang('table_prev')?>
                            </a>
                            <ul class="pagination listjs-pagination mb-0"></ul>
                            <a class="page-item pagination-next" href="javascrpit:void(0);">
                                <?=lang('table_next')?>
                            </a>
                        </div>
                    </div>
                </div>
            </div><!-- end card -->
        </div>
        <!-- end col -->
    </div>
    <!-- end col -->
</div>
<!-- end row -->