<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title">
                <h4 class="bold"><?php echo $title; ?> </h4>
            </div>
            <div class="row">
                <div class="col-md-3">
                    <label><?php echo CommonLanguage::getMessage('Date') ?></label>
                    <div class="input-group">
                        <span class="input-group-addon bg-primary"><i class="fa fa-calendar"></i></span>
                        <input id="From_To_Date" type="text" class="form-control" name="From_To_Date" >
                    </div>
                </div> 
            </div>
        </div>
        <div class="panel-body">
            <div class="row ">
                <div class="col-md-12 table-responsive">
                    <table class="table table-bordered inventory" id="tableWithSearch" >
                        <thead>
                            <tr>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('customer'); ?></th>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('bone_type'); ?></th>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('product'); ?></th>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('liters'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                        <tfoot>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var today = <?php echo json_encode($today) ?>;
    $(function () {
        ChangeTable();
        $("input[name=From_To_Date]").daterangepicker({
            ranges: {
                'Today': [moment(), moment()],
                'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                'This Month': [moment().startOf('month'), moment().endOf('month')],
                'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
            }
        }, function (start, end, label) {
            window.startDate = start.format("YYYY-MM-DD"),
                window.endDate = end.format("YYYY-MM-DD")
            ChangeTable();
        });
    })
    function ChangeTable() {
        var Date = {
            Date_From: window.startDate ? window.startDate : today,
            Date_To: window.endDate ? window.endDate : today};
         RebuildDataTable($('.panel-heading .panel-title').html(), [], "InventoryAjax/customerCouponPerDateAjax",Date);

    }
</script>