
<?php $this->load->view('site/layout'); ?>
<link href="<?php echo base_url() ?>public/css/style.bundle_front.css"
      rel="stylesheet" type="text/css" />
      <?php $this->load->view('site/navbar'); ?>
<style>
    .rtl{
        text-align: right !important;
    }
</style>
<div
    class="kt-content  kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor"
    id="kt_content">
    <!-- begin:: Content Head -->
    <div class="kt-subheader  kt-grid__item" id="kt_subheader">
        <div class="kt-container  kt-container--fluid ">
            <div class="kt-subheader__main">
                <h3 class="kt-subheader__title">
                    <a href="<?php echo base_url() ?>Dashboard/"><?php echo $this->lang->line('dashboard'); ?></a>
                </h3>
                <span class="kt-subheader__separator kt-subheader__separator--v"></span>
                <span class="kt-subheader__desc"><?php echo $this->lang->line('stores'); ?></span>
            </div>

        </div>
    </div>
</div>
<div
    class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid">
    <div class="kt-portlet kt-portlet--mobile">
        <div class="kt-portlet__head kt-portlet__head--lg">
            <div class="kt-portlet__head-label">
                <span class="kt-portlet__head-icon"> <i
                        class="kt-font-brand flaticon2-line-chart"></i>
                </span>
                <h3 class="kt-portlet__head-title">
                    <?php echo $this->lang->line('stores'); ?>
                </h3>
            </div>
            <?php if (get_ap('teacher_add', $this->operator_id) == 1) { ?>
                <div class="kt-portlet__head-toolbar">
                    <div class="kt-portlet__head-wrapper">
                        <div class="kt-portlet__head-actions">
                            &nbsp; <a href="<?= base_url() ?>/Stores/<?= $this->thispage ?>/add/"
                                      class="btn btn-brand btn-primary btn-icon-sm"> <i
                                    class="la la-plus"></i>
                                    <?php echo $this->lang->line('add-a-store') ?>
                            </a>
                        </div>
                    </div>
                </div>
            <?php } ?>
        </div>
        <?php if ($this->session->flashdata('msg')): ?>
            <br />
            <div class="alert alert-success alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"
                        aria-hidden="true">×</button>
                <h4>
                    <i class="icon fa-warning"></i> Success!
                </h4>&nbsp;
                <?= $this->lang->line('op_success'); ?>
            </div>
        <?php endif; ?> 
        <div class="kt-portlet__body">

            <!--begin: Datatable -->
            <table class="table table-bordered table-hover" id="list_table">
                <thead>

                    <tr>
                        <th style="width: 10px"><?php echo $this->lang->line('arrangement') ?></th>
                        <th><?php echo $this->lang->line('the-name') ?></th>
						<th> <?php echo $this->lang->line('the-phone') ?></th>
						<th><?php echo $this->lang->line('email') ?></th>
						<th><?php echo $this->lang->line('address') ?></th>

                        <th class="text-center"><?php echo $this->lang->line('action'); ?></th>
                    </tr>
                </thead>
                <tbody>   <?php
                    $count = 0;
                    foreach ($rows as $row) {
                        ?>
                        <tr>
                            <td><?php echo ++$count; ?></td>
                            <td><?= $row['name']; ?> </td>
							<td><?= $row['phone']; ?> </td>
                            <td><?= $row['email']; ?> </td>
                            <td><?= $row['address']; ?> </td>



                            <td class="text-center">
                                <?php if (get_ap('teacher_edit', $this->operator_id) == 1) { ?>
                                    <a href="<?= base_url('Stores/Store/edit/' . $row['id']) ?>"
                                       class="btn btn-icon btn-primary btn-sm" title="Edit">
                                        <i class="la la-edit"></i>
                                    </a>
                                <?php } ?>
                                <?php if (get_ap('teacher_del', $this->operator_id) == 1) { ?>
                                    <a onclick="alert_box(<?php echo $row['id'] ?>)"
                                       class="btn btn-icon btn-danger btn-sm" title="Delete">
                                        <i class="la la-trash"></i>
                                    </a>
                                <?php } ?>
                            </td>
                        </tr><?php } ?>
                </tbody>
            </table>

            <!--end: Datatable -->
        </div>
    </div>
</div>
<?php $this->load->view('site/footer_2'); ?>

<!-- <script src="<?php echo base_url() ?>public/plugins/global/plugins.bundle.js" type="text/javascript"></script>
     <script src="<?php echo base_url() ?>public/js/scripts.bundle.js" type="text/javascript"></script> -->

<!--end::Global Theme Bundle -->

<!--begin::Page Vendors(used by this page) -->
<!-- <script src="<?php echo base_url() ?>public/plugins/custom/datatables/datatables.bundle.js" type="text/javascript"></script> -->

<!--end::Page Vendors -->

<!--begin::Page Scripts(used by this page) -->
<!-- <script src="<?php echo base_url() ?>public/js/pages/crud/datatables/basic/basic.js" type="text/javascript"></script> -->

<script>function alert_box(id) {
        var result = confirm("Are You Confirm!")
        if (result) {
            window.location.href = "<?= base_url('Stores/' . $this->thispage . '/del/') ?>" + id;

        }

    }


    $(function () {
        $(".approve_switch").change(function () {
            location.href = "<?= base_url() ?>quraan/teacher/approve_status/" + $(this).data('url');
        });
        $("#list_table").DataTable({dom: 'Bfrtip',
            destroy: true,
            buttons: [
                {
                    extend: 'excelHtml5',
                    charset: 'UTF-16LE',
                    fieldSeparator: '\t',
                    bom: true
                },
                {
                    extend: 'csvHtml5',
                    charset: 'UTF-16LE',
                    fieldSeparator: '\t',
                    bom: true
                },
                {
                    extend: 'pdfHtml5',
                    charset: 'UTF-16LE',
                    fieldSeparator: '\t',
                    bom: true
                },
                {
                    extend: 'print',
                    autoPrint: false,
                    footer: true
                }

            ]
        });
//            buttons: [
//                'copyHtml5',
//                'excelHtml5',
//                'csvHtml5',
//                'pdfHtml5'
//            ]
    });


</script>
