<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }

    .nodata {
        background-color: #72B4EC;
        color: white;
        border-radius: 13px;
        margin: 14px;
        font-size: 24px;
        text-align: center;
        padding: 5px;
    }

    @media print {
        @page {
            size: landscape;
            margin: 0;
        }

        .willprint,
        .willprint td,
        .willprint th {
            font-family: arial;
            font-size: 14px;
            border-collapse: collapse;
            border: 1px solid #333 !important;
        }

        /* .willprint th{
            background: #aaa !important;
        } */
        .willprint tr:even-child td {
            background: #333 !important;
            color: #fff !important;
        }
    }
</style>



<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير العملاء بدون فواتير</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقريرالعملاء بدون فواتير
                <!-- <a href="{$youtubes[138]->url}" target="_blank" class="hidden-print"><img
                        src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube"
                        style="width: 2%;"></a> -->
            </div>
            <div class="panel-body">
                <form class="form-inline hidden-print" action="clientsWithoutBills.php" method="post">
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"
                            data-date-format="yyyy-mm-dd" name="datefrom">
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"
                            data-date-format="yyyy-mm-dd" name="dateto">
                    </div>
                    <div class="form-group col-lg-2">
                        <label class="sr-only">المحافظة - المنطقة</label>
                        <span id="spryselect1">
                            <input type="hidden" name="clientareaid" value="0" id="clientareaid" />
                            <span class="selectInvalidMsg">اختر الشركة - المنطقة</span></span>
                    </div>
            </div>

            <br />
            <button type="submit" class="btn btn-primary">بحث</button>
            </form>

        </div>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">{$message}</div>
            <div class="panel-heading">{$messageData}</div>


            {if $resultsCount > 0 }
            <table class="stable dataTableClass willprint table-black" style="width: 100%">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>اسم العميل</th>
                        <th> تاريخ أخر فاتورة</th>
                    </tr>

                </thead>
                <tbody>

                    {assign var=i value=1}
                    {foreach $sellbillDataArr as $data}
                    <tr>
                        <td>{$i}</td>
                        <td>{$data->clientname}</td>
                        <td><a href="sellbillController.php?do=showDetail&sellbillid={$data->lastBillId}">{$data->lastBillDate}</a>
                        </td>
                    </tr>
                    {assign var=i value=$i+1}
                    {/foreach}

                </tbody>

            </table>
            {else}
            <div class="nodata">عفوا لا توجد نتائج</div>
            {/if}

            <div class="clearfix"></div>
            <hr />
            <div class="noprint">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-4">
                            <button type="button" onclick="print_Custom('mycustomheader');"
                                class="btn btn-success pull-right hidden-print">طباعة</button>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>


            <div class="clearfix"></div>
        </div>
    </div>
</div>

{literal}
<script>
    $(document).ready(function () {
        var formatResult = function (data) {
            return data.text;
        }
        $('#clientareaid').select2({
            placeholder: "اختر الشركة  - المنطقة",
            //minimumInputLength: 2,
            //triggerChange: true,
            //allowClear: true,
            ajax: {
                url: 'clientControllerAjax.php?do=getclientarea',
                dataType: 'json',
                type: "POST",
                data: function (term) {
                    return {
                        searchTerms: term,
                        //governmentid : $('#clientgovernmentid').val()
                    };
                },
                results: function (data) {
                    return {
                        results: data,
                    };
                }
            },
            formatResult: formatResult,
            //        initSelection: function (element, callback) {
            //            var item = element.val().split(':');
            //            var data = {id: item[0], name: item[1]};
            //            callback(data);
            //        }
        });
    });
</script>
{/literal}