<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">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير بمدفوعات العملاء مجمع
                <a href="{$youtubes[140]->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="clientpayments.php" method="post">
                    <div class="form-group col-lg-3">
                        <label class="sr-only">المحافظة</label>
                        <select class="select2 wdt100" name="govid" id="govid">
                            <option value="">اختر</option>
                            {foreach $allGovs as $data}
                            <option value="{$data->governmetid}">{$data->governmentname}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="form-group col-lg-3">
                        <label class="sr-only">الشركة / المنطقة</label>
                        <select class="select2 wdt100" name="areaid" id="areaid">
                            <option></option>

                        </select>
                    </div>
                    <div style="clear:both"></div>
                    <div class="form-group col-lg-3">
                        <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 col-lg-3">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="dateto" >
                    </div>
                    <br />
                    <button type="submit" class="btn btn-primary">بحث</button>
                    <div style="clear: both"></div>
                    <br />
                </form>

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


                {if $resultsCount > 0 }
                <div class="clearfix"></div>
                <br/>
                <div class="col-lg-offset-8 col-lg-4">
                    <div class="well well-sm">
                        <h4 class="text-center">إجمالي المدفوع <br/>
                            {$sum}  {$currency}</h4>
                    </div>
                </div>
                <div class="clearfix"></div>
                <table class="stable dataTableClass willprint " style="width: 100%">
                    <thead>
                        <tr>
                            <th >#</th>
                            <th >اسم العميل</th>
                            <th >المدفوع </th>
                        </tr>

                    </thead>
                    <tbody>

                        {assign var=i value=1}
                        {foreach $sellbillDataArr as $data}
                        {if $data->totalpayed neq 0}
                        <tr>
                            <td >{$i}</td>
                            <td >{$data->clientname}</td>
                            <td >{$data->totalpayed}</td>
                        </tr>
                        {assign var=i value=$i+1}
                        {/if}
                        {/foreach}
                    </tbody>

                </table>
                <div class="clearfix"></div>
                <br/>
                <div class="col-lg-offset-8 col-lg-4">
                    <div class="well well-sm">
                        <h4 class="text-center">إجمالي المدفوع <br/>
                            {$sum}  {$currency}</h4>
                    </div>
                </div>
                <div class="clearfix"></div>
                {else}
                <div class="nodata">عفوا لا توجد نتائج</div>
                {/if}

                <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>
