
<?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>
    .Select-menu-outer {
        display : block !important;
    }
    .nav-item{
        margin: 0px 10px !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('quraan_session'); ?></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('quraan_session'); ?>
                </h3>
            </div>

            <div class="kt-portlet__head-toolbar">
                <div class="kt-portlet__head-wrapper">
                    <div class="kt-portlet__head-actions">
                        <?php if (get_ap('session_add_recite', $this->operator_id)) { ?>
                            &nbsp; <a
                                href="<?= base_url() ?>/quraan/<?= $this->thispage ?>/add_recite/<?= $product_id ?>"
                                class="btn btn-brand btn-elevate btn-icon-sm btn-primary"> <i
                                    class="la la-plus"></i>
                                    <?php echo $this->lang->line('add-a-recite') ?>
                            </a>
                        <?php } ?>
                        <?php if (get_ap('add_students', $this->operator_id)) { ?>
                            <a
                                href="<?= base_url() ?>/quraan/<?= $this->thispage ?>/add_students/<?= $product_id ?>"
                                class="btn btn-brand btn-elevate btn-icon-sm btn-info"> <i
                                    class="la la-plus"></i>
                                    <?php echo $this->lang->line('add_students') ?>
                            </a>
                        <?php } ?>
                    </div>
                </div>
            </div>

        </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="card card-custom gutter-b">
            <div class="card-body">
                <ul class="nav nav-tabs nav-tabs-line mb-10">
                    <?php
                    $active = 0;
                    if (get_ap('session_summary', $this->operator_id)) {
                        ?>
                        <li class="nav-item"><a class="nav-link <?= !$active ? 'active' : '' ?>" data-toggle="tab"
                                                href="#kt_tab_pane_1"> <span class="nav-icon"> <i
                                        class="flaticon2-document"></i>
                                </span> <span class="nav-text"><?= $this->lang->line('summary') ?></span>
                            </a></li>
                        <?php
                        $active = 1;
                    }
                    ?>
                    <?php if (get_ap('session_students', $this->operator_id)) { ?>
                        <li class="nav-item"><a class="nav-link <?= !$active ? 'active' : '' ?>" data-toggle="tab"
                                                href="#kt_tab_pane_2"> <span class="nav-icon"> <i
                                        class="fas fa-users"></i>
                                </span> <span class="nav-text"><?= $this->lang->line('students') ?></span>
                            </a></li>
                        <?php
                        $active = 1;
                    }
                    ?>
                    <?php
                    $controller_path = dirname(__DIR__, 3);
//                    if (file_exists($controller_path . '/controllers/absent')) {
                    ?>
                    <?php //if (get_ap('session_attendance', $this->operator_id)) { ?>
<!--                            <li class="nav-item"><a class="nav-link <?//= !$active ? 'active' : '' ?>" data-toggle="tab"
href="#kt_tab_pane_3"> <span class="nav-icon"> <i
class="far fa-list-alt"></i>
</span> <span class="nav-text"><?//= $this->lang->line('attendance') ?></span>
</a></li>-->
                    <?php
//                            $active = 1;
//                        }
//                    }
                    ?>
                    <?php
                    //if (file_exists($controller_path . '/controllers/announcement')) {
                    //    if (get_ap('session_messages', $this->operator_id)) {
                    ?>
<!--                            <li class="nav-item"><a class="nav-link  <?//= !$active ? 'active' : '' ?>" data-toggle="tab"
href="#kt_tab_pane_4"> <span class="nav-icon"> <i
class="fa fa-envelope-open-text"></i>
</span> <span class="nav-text"><?//= $this->lang->line('messages') ?></span>
</a></li>-->
                    <?php
                    //$active = 1;
                    // }
                    //  }
                    ?>
                    <?php //if (get_ap('session_expired_membership', $this->operator_id)) { ?>
<!--                        <li class="nav-item"><a class="nav-link <?//= !$active ? 'active' : '' ?>" data-toggle="tab"
href="#kt_tab_pane_5"> <span class="nav-icon"> <i
class="fas fa-user-slash"></i>
</span> <span class="nav-text"><?//= $this->lang->line('expired_membership') ?></span>
</a></li>-->
                    <?php //} ?>

                </ul>
                <div class="tab-content mt-5" id="myTabContent">
                    <?php
                    $active = 0;
                    if (get_ap('session_summary', $this->operator_id)) {
                        ?>
                        <div class="tab-pane fade <?= !$active ? 'show active' : '' ?>" id="kt_tab_pane_1"
                             role="tabpanel" aria-labelledby="kt_tab_pane_2">

                            <form class="kt-form kt-form--label-right" method="post" action="">
                                <div class="kt-portlet__body">
                                    <div class="form-group row">
                                        <label for="example-text-input" class="col-2 col-form-label"><?php echo $this->lang->line('date') ?></label>
                                        <div class="col-9">
                                            <input type="text" name="start_expiry_summary" id="start_expiry_summary"
                                                   class="form-control" value="<?= set_value('start_expiry_summary') ?>">
                                        </div>
                                        <div class="col-1" style="padding-left: 0px">
                                            <a onclick="clear_date()"
                                               class="btn btn-light btn-text-primary btn-hover-text-primary font-weight-bold"><?= $this->lang->line('clear') ?></a>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <div class="col-1"></div>
                                        <button
                                            class="btn btn-brand btn-elevate btn-icon-sm mr-5 btn-primary">
                                                <?php echo $this->lang->line('submit') ?>
                                        </button>

                                    </div>
                                </div>
                            </form>
                            <br/><br/>

                            <table class="table table-bordered table-hover list_table">
                                <thead>
                                    <tr>
                                        <th style="width: 10px"><?php echo $this->lang->line('arrangement') ?></th>
                                        <th><?php echo $this->lang->line('student') . ' ' . $this->lang->line('name') ?></th>
                                        <th><?php echo $this->lang->line('pages_count') . ' حفظ' ?></th>
                                        <th><?php echo $this->lang->line('pages_count') . ' مراجعة' ?></th>
                                        <th><?php echo $this->lang->line('pages_count') . ' سرد' ?></th>
                                        <th><?php echo $this->lang->line('pages_count') . ' تلاوة' ?></th>
                                        <th><?php echo $this->lang->line('pages_count') . ' تلقين' ?></th>
                                        <th><?php echo $this->lang->line('pages_count') . ' اختبار' ?></th>


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


                                            <td><?= round($row['hfz'], 2); ?></td>
                                            <td><?= round($row['mrg3a'], 2); ?></td>
                                            <td><?= round($row['srd'], 2); ?></td>
                                            <td><?= round($row['tlawa'], 2); ?></td>
                                            <td><?= round($row['tlken'], 2); ?></td>
                                            <td><?= round($row['test'], 2); ?></td>

                                            <td class="text-center">

                                                <a
                                                    href="<?= base_url('quraan/' . $thispage . '/show_detailed_recite/' . $product_id . '/' . $row['id']) ?>"
                                                    class="btn btn-icon btn-info btn-sm"
                                                    title="<?= $this->lang->line('show_details') ?>"> <i
                                                        class="far fa-eye"></i>
                                                </a>


                                            </td>

                                        </tr><?php } ?>
                                </tbody>
                            </table>


                        </div>
                        <?php
                        $active = 1;
                    }
                    ?>
                    <?php if (get_ap('session_students', $this->operator_id)) { ?>
                        <div class="tab-pane <?= !$active ? 'show active' : '' ?>" id="kt_tab_pane_2" role="tabpanel"
                             aria-labelledby="kt_tab_pane_2">

                            <form class="kt-form kt-form--label-right" method="post" action="">
                                <div class="kt-portlet__body">
                                    <div class="form-group row">
                                        <label for="example-text-input" class="col-2 col-form-label"><?php echo $this->lang->line('date') ?></label>
                                        <div class="col-9">
                                            <input type="text" name="start_expiry_summary" id="start_expiry_summary"
                                                   class="form-control" value="<?= set_value('start_expiry_summary') ?>">
                                        </div>
                                        <div class="col-1" style="padding-left: 0px">
                                            <a onclick="clear_date()"
                                               class="btn btn-light btn-text-primary btn-hover-text-primary font-weight-bold"><?= $this->lang->line('clear') ?></a>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <div class="col-1"></div>
                                        <button
                                            class="btn btn-brand btn-elevate btn-icon-sm mr-5 btn-primary">
                                                <?php echo $this->lang->line('submit') ?>
                                        </button>

                                    </div>
                                </div>
                            </form>


                            <table class="table table-bordered table-hover list_table">
                                <thead>

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

                                        <th><?php echo $this->lang->line('nationality') ?></th>
                                        <th><?php echo $this->lang->line('phone') ?></th>
                                        <?php
                                        if (get_license_per('attendance')) {
                                            if (file_exists($controller_path . '/controllers/absent')) {
                                                if (get_ap('attendance_module', $this->operator_id)) {
                                                    ?>
                                                    <th><?= $this->lang->line('attendance') ?></th>

                                                    <th class="text-center"><?php echo $this->lang->line('attendance') ?></th>
                                                    <?php
                                                }
                                            }
                                        }
                                        ?>
                                        <th class="text-center"><?= $this->lang->line('action') ?></th>
                                    </tr>
                                </thead>
                                <tbody>   <?php
                                    $count = 0;
                                    foreach ($students as $row) {
                                        ?>
                                        <tr>
                                            <td><?php echo ++$count; ?></td>
                                            <td><?= $row['student_name']; ?> </td>

                                            <td><?= $row['nationality']; ?> </td>
                                            <td><?= $row['phone']; ?> </td>
                                            <?php
                                            if (get_license_per('attendance')) {
                                                if (file_exists($controller_path . '/controllers/absent')) {
                                                    if (get_ap('attendance_module', $this->operator_id)) {
                                                        ?>
                                                        <td><?= $row['attend_days'] ?></td>
                                                        <td class="text-center">
                                                            <a
                                                                href="<?= base_url('quraan/' . $thispage . '/show_session_attendance/' . $product_id . '/' . $row['id']) ?>"
                                                                class="btn btn-icon btn-info btn-sm"
                                                                title="<?= $this->lang->line('show_attendance_details') ?>"> <i
                                                                    class="fas fa-list-alt"></i>
                                                            </a></td>
                                                        <?php
                                                    }
                                                }
                                            }
                                            ?>
                                            <td class="text-center">
                                                <?php if (get_ap('sessions_plans', $this->operator_id)) { ?>
                                                    <a href="<?= base_url('quraan/' . $this->thispage . '/plans/' . $product_id . '/' . $row['id']) ?>" 
                                                       class="btn btn-icon btn-success btn-sm" title="<?= $this->lang->line('sessions_plans') ?>" >
                                                        <i class="far fa-list-alt" ></i>
                                                    </a>
                                                <?php } ?>
                                                <?php if (get_ap('session_delete_student', $this->operator_id)) { ?>
                                                    <a onclick="return confirm('Are you sure, you want to delete it?')"
                                                       href="<?= base_url('quraan/' . $thispage . '/del_student/' . $product_id . '/' . $row['id']) ?>"
                                                       class="btn btn-icon btn-danger btn-sm"
                                                       title="<?= $this->lang->line('delete') ?>"> <i
                                                            class="la la-trash"></i>
                                                    </a>
                                                <?php } ?>
                                            </td>
                                        </tr><?php } ?>
                                </tbody>
                            </table>


                        </div>
                        <?php
                        $active = 1;
                    }
                    ?>


                    <?php
//                    if (file_exists($controller_path . '/controllers/absent')) {
//                        if (get_ap('session_attendance', $this->operator_id)) {
                    ?>
<!--                            <div class="tab-pane <?//= !$active ? 'show active' : '' ?>" id="kt_tab_pane_3" role="tabpanel"
                                 aria-labelledby="kt_tab_pane_2">

                                <form class="kt-form kt-form--label-right" method="post" action="">
                                    <div class="kt-portlet__body">-->
                    <!--                                        <div class="form-group row">
                                                                <label for="example-text-input" class="col-2 col-form-label"><?php //echo $this->lang->line('date')                   ?></label>
                                                                <div class="col-9">
                                                                    <input type="text" name="start_expiry" id="start_expiry"
                                                                           class="form-control" value="<?//= set_value('start_expiry') ?>">
                                                                </div>
                                                                <div class="col-1" style="padding-left: 0px">
                                                                    <a onclick="clear_date()"
                                                                       class="btn btn-light btn-text-primary btn-hover-text-primary font-weight-bold"><?//= $this->lang->line('clear') ?></a>
                                                                </div>
                                                            </div>-->
                    <!--                                        <div class="form-group row">
                                                                <label for="example-text-input" class="col-2 col-form-label"><?php //echo $this->lang->line('student')                  ?></label>
                                                                <div class="col-9">
                                                                    <select multiple data-multi-select-plugin name="username[]"
                                                                            class="topnav form-control">
                    <?php
//                                                            foreach ($students as $value) {
//                                                                $selected = '';
//                                                                if (!empty($this->input->post('username'))) {
//                                                                    if (in_array($value['student_name'], $this->input->post('username'))) {
//                                                                        $selected = 'selected';
//                                                                    }
//                                                                }
                    ?>
                                                                            <option <?//= $selected ?>
                                                                                value="<?php //echo $value['student_name']                   ?>"><?php //echo $value['student_name']                   ?></option>
                    <?php //}    ?>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div class="form-group row">
                                                                <label for="example-text-input" class="col-2 col-form-label"><?php //echo $this->lang->line('attend_status')                  ?></label>
                                                                <div class="col-9">
                                                                    <select multiple data-multi-select-plugin
                                                                            name="attend_status[]" class="topnav form-control">
                    <?php
//                                                            $selected1 = $selected2 = $selected3 = '';
//                                                            if (!empty($this->input->post('attend_status'))) {
//                                                                if (in_array($this->lang->line('present'), $this->input->post('attend_status'))) {
//                                                                    $selected1 = 'selected';
//                                                                }
//                                                                if (in_array($this->lang->line('absent'), $this->input->post('attend_status'))) {
//                                                                    $selected2 = 'selected';
//                                                                }
//                                                                if (in_array($this->lang->line('late'), $this->input->post('attend_status'))) {
//                                                                    $selected3 = 'selected';
//                                                                }
//                                                            }
                    ?>
                                                                        <option <?//= $selected1 ?>
                                                                            value="<?php //echo $this->lang->line('present')                   ?>"></option>
                                                                        <option <?//= $selected2 ?>
                                                                            value="<?php //echo $this->lang->line('absent')                   ?>"></option>
                                                                        <option <?//= $selected3 ?>
                                                                            value="<?php //echo $this->lang->line('late')                   ?>"></option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <input type="hidden" value="1" name="form_2_submit" />
                                                            <div class="form-group row">
                                                                <div class="col-1"></div>
                                                                <button
                                                                    class="btn btn-brand btn-elevate btn-icon-sm mr-5 btn-primary">
                    <?php //echo $this->lang->line('submit')    ?>
                                                                </button>
                    
                                                            </div>
                                                        </div>
                                                    </form>
                    
                                                    <table class="table table-bordered table-hover list_table">
                                                        <thead>
                                                            <tr>
                                                                <th><?php //echo $this->lang->line('sno')                   ?></th>
                                                                <th><?php //echo $this->lang->line('the-name')                   ?></th>
                                                                <th><?//= $this->lang->line('present') ?></th>
                                                                <th><?//= $this->lang->line('absent') ?></th>
                                                                <th><?//= $this->lang->line('late') ?></th>
                                                                <th><?php //echo $this->lang->line('total_days')                   ?></th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                    
                    <?php
//                                        $count = 1;
//                                        foreach ($attendance as $row) {
                    ?>
                                                                <tr>
                                                                    <td><?php //echo $count++;                   ?></td>
                                                                    <td><?//= $row->username ?></td>
                                                                    <td><?//= $row->present ? "<a href=" . base_url('absent/detailed_absent/' . $product_id . '/' . $row->user_id . '/1') . ">" . $row->present . "</a>" : $row->present ?></td>
                                                                    <td><?//= $row->absent ? "<a href=" . base_url('absent/detailed_absent/' . $product_id . '/' . $row->user_id . '/0') . ">" . $row->absent . "</a>" : $row->absent ?></td>
                                                                    <td><?//= $row->late ? "<a href=" . base_url('absent/detailed_absent/' . $product_id . '/' . $row->user_id . '/2') . ">" . $row->late . "</a>" : $row->late ?></td>
                                                                    <td><?//= $row->total_days ? "<a href=" . base_url('absent/detailed_absent/' . $product_id . '/' . $row->user_id) . ">" . $row->total_days . "</a>" : $row->total_days ?></td>
                                                                </tr>
                    <?php //}    ?>
                                                        </tbody>
                                                    </table>
                    
                    
                    
                                                </div>-->
                    <?php
//                            $active = 1;
//                        }
                    ?>
                    <?php //} ?>
                    <?php
//                    if (file_exists($controller_path . '/controllers/announcement')) {
//                        if (get_ap('session_messages', $this->operator_id)) {
                    ?>
                    <!--                            <div class="tab-pane <?= !$active ? 'show active' : '' ?>" id="kt_tab_pane_4" role="tabpanel"
                                                     aria-labelledby="kt_tab_pane_2">
                                                    <div class="card-body">
                    <?php if (empty($announcments)) { ?>
                                                                                                                                    <div class="alert alert-warning alert-dismissible">
                                                                                                                                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">Ã—</button>
                                                                                                                                        <div>
                        <?= $this->lang->line('no_msgs'); ?>
                                                                                                                                        </div>
                                                                                                                                    </div>
                    <?php } ?>
                                                        begin::Top
                    
                    
                                                        begin::Example
                                                        <div class="example example-basic">
                                                            <div class="example-preview">
                                                                begin::Timeline
                                                                <div class="timeline timeline-3">
                                                                    <div class="timeline-items">
                    <?php
//                                                    $icon_color = array(
//                                                        'text-danger',
//                                                        'text-primary',
//                                                        'text-warning',
//                                                        'text-info'
//                                                    );
//                                                    $i = 0;
//                                                    foreach ($announcments as $ann) {
                    ?>
                                                                            <div class="timeline-item">
                                                                                <div class="timeline-media">
                                                                                    <i class="fa fa-envelope <?//= $icon_color[$i] ?>"></i>
                                                                                </div>
                                                                                <div class="timeline-content">
                                                                                    <div
                                                                                        class="d-flex align-items-center justify-content-between mb-3">
                                                                                        <div class="mr-2">
                                                                                            <a
                                                                                                class="text-dark-75 text-hover-primary font-weight-bold prod_name"> &nbsp;&nbsp; <?//= $ann->product_name ?></a>
                                                                                            <span class="text-muted ml-2" style="float: left"><?//= date('d F Y h:ma', strtotime($ann->date_added)) ?></span>
                    
                                                                                        </div>
                    
                                                                                    </div>
                                                                                    <p class="p-0"><?//= $ann->msg ?></p>
                                                                                </div>
                                                                            </div>
                    <?php
//                                                        $i ++;
//                                                        if ($i == 4) {
//                                                            $i = 0;
//                                                        }
//                                                    }
                    ?>
                                                                    </div>
                                                                </div>
                                                                end::Timeline
                                                            </div>
                                                        </div>
                                                        end::Example
                    
                                                    </div>
                    
                                                </div>-->
                    <?php
//                            $active = 1;
//                        }
//                    }
                    ?>


                    <?php //if (get_ap('session_expired_membership', $this->operator_id)) {     ?>
<!--                    <div class="tab-pane fade <?//= !$active ? 'show active' : '' ?>" id="kt_tab_pane_5"
     role="tabpanel" aria-labelledby="kt_tab_pane_5">


    <table class="table table-bordered table-hover list_table">
        <thead>

            <tr>
                <th style="width: 10px"><?php //echo $this->lang->line('arrangement')                       ?></th>
                <th><?php //echo $this->lang->line('student') . ' ' . $this->lang->line('name')                       ?></th>
                <th><?php //echo $this->lang->line('pages_count') . ' حفظ'                       ?></th>
                <th><?php //echo $this->lang->line('pages_count') . ' مراجعة'                       ?></th>
                <th><?php //echo $this->lang->line('pages_count') . ' سرد'                      ?></th>
                <th><?php //echo $this->lang->line('pages_count') . ' تلاوة'                     ?></th>
                <th><?php //echo $this->lang->line('pages_count') . ' تلقين'                     ?></th>
                <th class="text-center"><?//= $this->lang->line('show_details') ?></th>
            </tr>
        </thead>
        <tbody>   <?php
//                                $count = 0;
//                                if (isset($expired_students)) {
//                                    foreach ($expired_students as $row) {
                    ?>
                    <tr>
                        <td><?php //echo ++$count;                       ?></td>
                        <td><?//= $row['student_name']; ?> </td>


                        <td><?//= $row['hfz']; ?></td>
                        <td><?//= $row['mrg3a']; ?></td>
                        <td><?//= $row['srd']; ?></td>
                        <td><?//= $row['tlawa']; ?></td>
                        <td><?//= $row['tlken']; ?></td>
                        <td class="text-center"><a
                                href="<?//= base_url('quraan/' . $thispage . '/show_detailed_recite/' . $product_id . '/' . $row['id']) ?>"
                                class="btn btn-icon btn-danger btn-sm"
                                title="<?//= $this->lang->line('show_details') ?>"> <i
                                    class="far fa-eye"></i>
                            </a></td>


                    </tr><?php
//                            }
//                        }
                    ?>
        </tbody>
    </table>


</div>-->
                    <?php //}      ?>



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

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

        }

    }

    function clear_date() {
        $("#start_expiry").val('');
        $("#start_expiry_summary").val('');
    }


    $(function () {
        $('input[name="start_expiry_summary"]').daterangepicker();
<?php if (isset($active_3)) { ?>
            $('.nav-tabs a[href="#kt_tab_pane_3"]').tab('show');
<?php } ?>
        $(".approve_check").change(function () {
            var status = 0;
            if ($(this).prop('checked')) {
                var status = 1;
            }
            var id = $(this).data('mem_id');
            location.href = "<?= base_url('users/change_member_status/') ?>" + id + '/' + status;
        });
        $(".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>
