<link rel="stylesheet" href="<?php echo base_url(); ?>public/static/backend/css/layouts/view.css?v=<?= rand(10000, 100000) ?>">
<link rel="stylesheet" href="<?php echo base_url(); ?>public/static/backend/css/drag_list.css">
<!-- Page Breadcrumb -->
<div class="page-breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="<?= base_url('backend/dashboard'); ?>" style="color: #797979">主頁</a>
        </li>
        <li>
            <i class="fa fa-home"></i>
            <a href="<?= base_url('backend/customer_contact'); ?>" style="color: #797979">客戶查詢管理</a>
        </li>
        <li class="active" style="color: #ef4130">客戶查詢管理</li>
    </ul>
</div>
<!-- /Page Breadcrumb -->
<!-- Page Header -->
<div class="page-header position-relative">
    <div class="header-title">
        <h1>
            客戶查詢管理
        </h1>
    </div>
    <div class="header-buttons">
        <a class="sidebar-toggler" href="#">
            <i class="glyphicon glyphicon-resize-horizontal"></i>
        </a>
        <a class="refresh" id="refresh-toggler" href="#">
            <i class="glyphicon glyphicon-refresh"></i>
        </a>
        <a class="fullscreen" id="fullscreen-toggler" href="#">
            <i class="glyphicon glyphicon-fullscreen"></i>
        </a>
    </div>
    <!--Header Buttons End-->
</div>

<div class="page-body">
    <section class="box-typical">
        <div class="fixed-table-toolbar">
            <div class="bars pull-left">
                <div id="toolbar"><strong>客戶查詢紀錄</strong></div>
            </div>
            <div class="pull-right search"></div>
        </div>

        <table id="myTable" class="table table-bordered">
            <thead>
                <th>id</th>
                <th>客戶名稱</th>
                <th>聯絡電話</th>
                <th>電郵地址</th>
                <th>想更健康</th>
                <th>想減體重</th>
                <th>想挑戰自己</th>
                <th>想體態更好</th>
                <th>其他原因</th>
                <th>原因</th>
                <th>已回覆</th>
                <th>回覆</th>
            </thead>
            <tbody>
              
            </tbody>
        </table>


    </section>

</div>

<script>
   var table, data = [];
    $(document).ready(function() {
        table = $('#myTable').DataTable({
            "processing": true,
            "serverSide": true,
            "ajax": "/backend/customer_contact/listing",
            "columns": [{
                    'data': 'id',
                    "name":"id"
                },
                {
                    'data':"name",
                    "name":"客戶名稱"
                },
                {
                    'data':"phone_no",
                    "name":"聯絡電話"
                },
                {
                    'data':'email',
                    "name":"電郵地址"
                },
                   {
                    'data':"health",
                    "name":"想更健康"
                },
                {
                    'data':"loss_weight",
                    "name":"想減體重"
                },
                {
                    'data':"challenge",
                    "name":"想挑戰自己"
                },
                {
                    'data':"body_makeup",
                    "name":"想體態更好"
                },
                {
                    'data':"other",
                    "name":"其他原因"
                },
                {
                    'data':"reason",
                    "name":"原因"
                },
                {
                    'data':"replied",
                    "name":"已回覆"
                },
                {
                    'data':"reply",
                    "name":"回覆"
                },


            ],
            "order": [0, "desc"],
            "columnDefs": [{
                    "targets": [],
                    "visible": false,
                    "searchable": false,
                },
                {
                    "targets": [0,1, 4],
                    "visible": true,
                    "searchable": true,
                    "orderable": true,
                },
                {
                    "targets": [2, 3 , 4],
                    "visible": true,
                    "searchable": true,
                    "orderable": false,
                },
                {
                    "targets": [5,6,7,8,9,10],
                    "visible": true,
                    "searchable": false,
                    "orderable": true,
                },
                {
                    "targets": [11],
                    "visible": true,
                    "searchable": false,
                    "orderable": false,
                },
            ],
        });
    });
</script>

<script>
<script src ="<?=base_url()?>public/static/backend/js/custom/customer_contact.js"></script>

</script>