
<style>

    @media print {
        table ,tbody,thead,th,tr,td{

        }
        .col-lg-4
        {

            padding-top:50px !important;
        }

        /* .panel-heading{
            padding-top:30px !important;
        }

        .panel-heading2{
            padding-top:30px !important;
        }

        .panel-heading3{
            padding-top:30px !important;
        } */
        .clientraw{
            padding-top:30px !important;
            padding-bottom:20px !important;

        }
        /* p,h4,h3,h2,h1,span,label,td,th,div.dataTables_info,a,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
        div.dataTables_wrapper div.dataTables_info,.panel-heading, tr.odd td.sorting_1,
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            color:#000!important
        } */
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            text-align: center;
            padding:5px!important;
        }
        table thead>tr>th{
            border:1px solid black
        }


    }



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

    .panel-heading2 {
        padding: 5px 15px;
        margin: -15px -15px 15px;
        background-color: rgba(209, 239, 196, 0.58);
        border-bottom: 1px solid #ddd;
        border-top-right-radius: 3px;
        border-top-left-radius: 3px;
    }
    .collapsebtn,
    .collapsegovernment{
        float: left;
        margin-top: -4px;
        height: 24px;
    }
    .icon{
        text-align: center;
        margin-bottom: 3px;
        padding-left: 1px;
    }

    .panel-heading3 {
        padding: 5px 15px;
        margin: -15px -15px 15px;
        background-color: rgb(178, 199, 169);
        border-bottom: 1px solid #ddd;
        border-top-right-radius: 3px;
        border-top-left-radius: 3px;
    }
</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 hidden-print" style="padding:0">
                <h3 class="panel-title hidden-print" style="display: inline-block;"> تقرير مبيعات بالمناطق</h3>
                <a href="{$youtubes[141]->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="sellingReportByArea.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">المحافظة</label>
                        <select class="select2 wdt300"  name="governmentid" id="governmentid" >
                            <option value="-1"> كل المحافظات</option>
                            {foreach $governmentData as $government}
                            <option value="{$government->governmetid}">{$government->governmentname}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="form-group areadiv" style="display: none;">
                        <label class="sr-only">المنطقه</label>
                        <select class="select2 wdt300"  name="clientareaid" id="clientareaid" >
                            <option value="-1">اختر منطقه</option>
                            {foreach $allclientareadrop as $myallclientareadrop}
                            <option value="{$myallclientareadrop->id}">{$myallclientareadrop->name}</option>
                            {/foreach}
                        </select>
                    </div>
                    <br>
                    <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="from" >
                    </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="to" >
                    </div>

                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
                <hr/>
                <div  id="tableWrap">

                    <div class="col-lg-12 ">

                        <div class=" governmentDiv">
                            <div class="panel panel-default">
                                <!-- Default panel contents -->
                                <div class="panel-heading  " style="margin-bottom:0 ;">
                                    تقرير مبيعات مناطق
                                </div>
                                <div class="panel-body  clientraw text-center" style="margin-bottom:0 ;">
                                    <table class="table table-black dataTableClass" id="excelTable">
                                        <thead>
                                            <tr>
                                                <th rowspan="2"> #</th>
                                        <th rowspan="2"> المنتج</th>
                                        <th colspan="2"> المبيعات</th>
                                        <th colspan="2">المرتجعات</th>
                                        <th colspan="2"> صافى المبيعات</th>
                                        <th>الخصومات</th>
                                            </tr>

                                            <tr>
                                                <th>عدد </th>
                                            <th>قيمة </th>
                                            <th>عدد </th>
                                            <th>قيمة </th>

                                            <th>عدد </th>
                                            <th>قيمة </th>

                                            <th>القيمة</th><!--th> </th-->
                                            </tr>

                                            </thead>
                                            <tbody>
                                                {assign var=i value=1}
                                                {foreach $allDataArr as $pro }
                                                <tr>

                                                    <td>{$i}</td>
                                                <td>{$pro->productName}</td>
                                                <td>{$pro->soldNo}</td>
                                                <td>{$pro->soldVal}</td>
                                                <td>{$pro->returnNo}</td>
                                                <td>{$pro->returnVal}</td>
                                                <td> {$pro->netNo}</td>
                                                <td> {$pro->netVal}</td>
                                                <td>{$pro->discount}</td>
                                                <!--td>  </td-->
                                                </tr>
                                                {assign var=i value=$i+1}
                                                {/foreach}

                                                </tbody>
                                                </table>
                                                </div>
                                                <!--panel-body-->
                                                </div>
                                                <!--panel panel-default-->



                                                <div class="col-lg-12">
                                                    <div class="panel panel-default">
                                                        <!-- Default panel contents -->
                                                        <div class="panel-heading3"> الاجمالى العام</div>
                                                        <div class="panel-body">
                                                            <table class="table table-black">
                                                                <thead>
                                                                    <tr>
                                                                        <th rowspan="2"></th>
                                                                        <th rowspan="2"> </th>
                                                                        <th colspan="2"> المبيعات</th>
                                                                <th colspan="2"> المرتجعات</th>
                                                                <th colspan="2"> صافى المبيعات</th>
                                                                <th> الخصومات</th>
                                                                </tr>

                                                                <tr>
                                                                    <th>عدد </th>
                                                                <th>قيمة </th>
                                                                <th>عدد </th>
                                                                <th>قيمة </th>

                                                                <th>عدد </th>
                                                                <th>قيمة </th>

                                                                <th>القيمة </th><!--th> </th-->
                                                                </tr>

                                                                </thead>
                                                                <tbody >
                                                                    <tr>
                                                                        <td> </td>    <td> </td>
                                                                        <td>{$totalsObj->soldNo}</td>
                                                                <td>{$totalsObj->soldVal}</td>
                                                                <td>{$totalsObj->returnNo}</td>
                                                                <td>{$totalsObj->returnVal}</td>
                                                                <td>{$totalsObj->netNo}</td>
                                                                <td>{$totalsObj->netVal}</td>
                                                                <td>{$totalsObj->discount}</td>
                                                                <!--td> </td-->
                                                                </tr>
                                                                </tbody>
                                                            </table>
                                                        </div>
                                                        <!--panel-body-->
                                                    </div>
                                                    <!--panel panel-default-->


                                                    <hr />
                                                    <div  class="hidden-print">
                                                        <div class="row hidden-print">
                                                            <span><button type="button" onClick="print_Custom('mycustomheader');" class="btn btn-success pull-right">طباعة</button></span>
                                                            <span><button class="btn btn-success pull-right excelFile" data-tblId ="excelTable" data-path="">ملف اكسل</button></span>
                                                            <span id="ExcelStatus"></span>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </div>
                                                    <div class="clearfix"></div>
                                                </div>
                                                </div>
                                                </div>
                                                </div>
