<section class="mb-4" id="sale_area">
    <div class="card">
        <div class="card-header text-center py-3"> 
            <h5 class="mb-0 text-center">
                <strong>Order list</strong>
            </h5>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-3">
                    <?php
                        $general->inputBoxText('dRange','Date',date('d-m-Y').' to '.date('d-m-Y'),className:'daterangepickerMulti');
                    ?>
                </div>
                <div class="col-md-3">
                    <div class="col-md-2">
                        <button class="btn btn-success" onclick="order_list()">Search</button>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12" id="reportArea">

                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    function order_list(){
        let dRange  = $('#dRange').val();
        $('#reportArea').html(loadingImage);
        $.ajax({
            type:'post',
            url:ajUrl,
            data:{module:'order_list',dRange:dRange},
            success:function(data){
                $('#reportArea').html('');
                if(typeof(data.status)!=='undefined'){
                    if(data.status==1){
                        $('#reportArea').html(data.html);
                    }
                    swMessageFromJs(data.m);
                }
                else{
                    swMessage(AJAX_ERROR_MESSAGE); 
                }
            },
            error:function(){
                $('#reportArea').html('');
                swMessage(AJAX_ERROR_MESSAGE); 
            }
        });
    }
    
    $(document).ready(function(){
        order_list();
    })
</script>
