<style>
    @media print {

        .dataTables_length,
        .dataTables_filter,
        .dataTables_info,
        .dataTables_paginate {
            display: none !important;
        }

        .table-black {
            margin-top: 35px !important;
            margin-bottom: 35px !important;

        }

        .table-black {
            border: 1px solid black;
        }

        tr>td,
        tr>th {
            border: 1px solid #000 !important;
        }

        th>.sorting {
            border: 1px solid #000 !important;
        }

        .tab-content {
            color: black !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">الاشعارات<br />
                {if $message != ""}
                {$message}
                {/if}
                <a href="{$youtubes[125]->url}" target="_blank" class="hidden-print"><img
                        src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube"
                        style="width: 2%;"></a>
            </div>


            <!-- ================================================   -->
            <!-- Nav tabs -->
            <ul class="nav nav-tabs">
                {if $loadData->productno == "0"}<li {if $DDD neq 1 }class="active" {/if}><a href="#info"
                        data-toggle="tab"> المنتجات الاقل من الحد الادنى </a></li>{/if}
                {if $loadData->kempilano == "0"}<li><a href="#props" data-toggle="tab"> الكمبيالات</a></li>{/if}

                {if $loadData->productnotsellno == "0"}<li {if $DDD eq 1 } class="active" {/if}><a href="#genpro"
                        data-toggle="tab"> المنتجات الراكده من اسبوع</a></li>{/if}

                {if $loadData->clientcheckno == "0"}<li><a href="#check" data-toggle="tab"> شيكات العملاء </a></li>{/if}
                {if $loadData->suppliercheckno == "0"}<li><a href="#suppliercheck" data-toggle="tab"> شيكات الموردين
                    </a></li>{/if}
                {if $loadData->productRequist == "0"}<li><a href="#tabaaa" data-toggle="tab"> طلبات المنتجات </a></li>
                {/if}
                {if $loadData->otherRequist == "0"}<li><a href="#tabbbb" data-toggle="tab"> طلبات أخرى من الفروع </a>
                </li>{/if}
                {if $loadData->toWorkShopOrder == "0"}<li class="{if $loadData->toWorkShopOrder eq 1} hidden {/if}"><a
                        href="#delayOptic" data-toggle="tab">متاخرات البصريات</a></li>{/if}
                <li><a href="#premium" data-toggle="tab">الاقساط المتاخره</a></li>
                {if $loadData->insuranceBill == "0"}<li class="{if $loadData->insuranceBill eq 1} hidden {/if}"><a
                        href="#tabInsurance" data-toggle="tab"> فواتير التأمين</a></li>{/if}

            </ul>
            <!-- =================================================   -->
            <!-- Tab panes -->
            <div class="tab-content">
                <!-- start the  tabbbb -->
                {if $loadData->otherRequist == "0"}
                <div class="tab-pane" id="tabbbb">

                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab2" data-toggle="tab">{if $branchId == 0} طلبات قادمة للفروع
                                {else}طلبات قادمة للفرع {/if}</a></li>
                        <li><a href="#tab3" data-toggle="tab">{if $userGroupId == 1}طلبات قادمة لمجموعات المستخدمين
                                {else} طلبات قادمة لمجموعة المستخدمين {/if}</a></li>
                        <li><a href="#tab4" data-toggle="tab">{if $userGroupId == 1} طلبات قادمة للمستخدمين {else} طلبات
                                قادمة لى {/if}</a></li>
                    </ul>

                    <div class="tab-content">
                        <!-- start the 2nd tab -->
                        <div class="tab-pane active" id="tab2">

                            <div class="form-group">
                                <table class="table dataTableClass table-black">
                                    <thead>
                                        <tr>
                                            <th>م</th>
                                            <th>عنوان الطلب </th>
                                            <th> الفرع صاحب الطلب </th>
                                            <th> المستخدم </th>
                                            <th> التاريخ </th>
                                            <th class='hidden-print'> التفاصيل </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if $toBranchRequests }
                                        {assign var=i value=1}
                                        {foreach $toBranchRequests as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$data->requestTitle}</td>
                                            <td>{$data->branchName}</td>
                                            <td>{$data->userName}</td>
                                            <td>{$data->requestDate}</td>
                                            <td class="hidden-print"><a
                                                    href="otherrequests.php?do=details&id={$data->id}" type="button"
                                                    class="btn btn-default btn-lg notesicon"></a></td>

                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                        {/if}
                                    </tbody>
                                </table>
                                <button type="button" data-page="print_tab7_1" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                        <!-- end the 2nd tab -->

                        <!-- start the 3rd tab -->
                        <div class="tab-pane {if $toGroupRequests } {else} hidden-print {/if}" id="tab3">

                            <div class="form-group">
                                <table class="table dataTableClass table-black">
                                    <thead>
                                        <tr>
                                            <th>م</th>
                                            <th>عنوان الطلب </th>
                                            <th> الفرع صاحب الطلب </th>
                                            <th> المستخدم </th>
                                            <th> التاريخ </th>
                                            <th class='hidden-print'> التفاصيل </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if $toGroupRequests }
                                        {assign var=i value=1}
                                        {foreach $toGroupRequests as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$data->requestTitle}</td>
                                            <td>{$data->branchName}</td>
                                            <td>{$data->userName}</td>
                                            <td>{$data->requestDate}</td>
                                            <td class="hidden-print"><a
                                                    href="otherrequests.php?do=details&id={$data->id}" type="button"
                                                    class="btn btn-default btn-lg notesicon"></a></td>

                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                        {/if}
                                    </tbody>
                                </table>
                                <button type="button" data-page="print_tab7_2" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                        <!-- end the 3rd tab -->


                        <!-- start the 4th tab -->
                        <div class="tab-pane" id="tab4">

                            <div class="form-group">
                                <table class="table dataTableClass table-black">
                                    <thead>
                                        <tr>
                                            <th>م</th>
                                            <th>عنوان الطلب </th>
                                            <th> الفرع صاحب الطلب </th>
                                            <th> المستخدم </th>
                                            <th> التاريخ </th>
                                            <th class='hidden-print'> التفاصيل </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if $toUserRequests }
                                        {assign var=i value=1}
                                        {foreach $toUserRequests as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$data->requestTitle}</td>
                                            <td>{$data->branchName}</td>
                                            <td>{$data->userName}</td>
                                            <td>{$data->requestDate}</td>
                                            <td class="hidden-print"><a
                                                    href="otherrequests.php?do=details&id={$data->id}" type="button"
                                                    class="btn btn-default btn-lg notesicon"></a></td>

                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                        {/if}
                                    </tbody>
                                </table>
                                <button type="button" data-page="print_tab7_3" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                        <!-- end the 4th tab -->
                    </div>
                </div>
                {/if}
                <!-- end the  tabbbb -->

                <!-- start the  tabaaa -->
                {if $loadData->productRequist == "0"}
                <div class="tab-pane" id="tabaaa">

                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tabn" data-toggle="tab"> طلبات المنتجات من المخازن الاخرى </a></li>
                        <li><a href="#taba" data-toggle="tab"> طلبات المنتجات تمت الموافقة عليها </a></li>
                        <li><a href="#tabb" data-toggle="tab"> طلبات المنتجات تمت رفضها </a></li>
                    </ul>
                    <input type="hidden" name="userid" id="userid" value="{$userid}" />
                    <div class="tab-content">
                        <!-- start the  tabn -->
                        <div class="tab-pane active" id="tabn">

                            <div class="form-group">
                                <table class="table dataTableClass table-black">
                                    <thead>
                                        <tr>
                                            <th>م</th>
                                            <th>اسم المنتج</th>
                                            <th>صاحب الطلب </th>
                                            <th> المخزن المطلوب منه </th>
                                            <th> العدد المطلوب </th>
                                            <th class="hidden-print"> </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if $newRequests }
                                        {assign var=i value=1}
                                        {foreach $newRequests as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$data->productName}</td>
                                            <td>{$data->requestStoreName}</td>
                                            <td>{$data->storeName}</td>
                                            <td>{$data->productnoreq}</td>
                                            <td class="hidden-print"><button type="button" data-requestId="{$data->id}"
                                                    class="btn btn-primary seenBtn">تمت رؤيته</button></td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                        {/if}
                                    </tbody>
                                </table>
                                <button type="button" data-page="print_tab6_1" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                        <!-- end the  tabn -->

                        <!-- start the  taba -->
                        <div class="tab-pane  {if $acceptRequests }  {else} hidden-print {/if} " id="taba">

                            <div class="form-group">
                                <table class="table dataTableClass table-black">
                                    <thead>
                                        <tr>
                                            <th>م</th>
                                            <th>اسم المنتج</th>
                                            <th>صاحب الطلب </th>
                                            <th> المخزن المطلوب منه </th>
                                            <th> العدد المطلوب </th>
                                            <th> العدد الموافق عليه </th>
                                            <th> </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if $acceptRequests }
                                        {assign var=i value=1}
                                        {foreach $acceptRequests as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$data->productName}</td>
                                            <td>{$data->requestStoreName}</td>
                                            <td>{$data->storeName}</td>
                                            <td>{$data->productnoreq}</td>
                                            <td>{$data->productnoaccept}</td>
                                            <td><button type="button" data-requestId="{$data->id}"
                                                    class="btn btn-primary seenBtn">تمت رؤيته</button></td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                        {/if}
                                    </tbody>
                                </table>
                                <button type="button" data-page="print_tab6_2" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                        <!-- end the  taba -->

                        <!-- start the  tabb -->
                        <div class="tab-pane  {if $refusedRequests }  {else} hidden-print {/if} " id="tabb">

                            <div class="form-group">
                                <table class="table dataTableClass table-black">
                                    <thead>
                                        <tr>
                                            <th>م</th>
                                            <th>اسم المنتج</th>
                                            <th>صاحب الطلب </th>
                                            <th> المخزن المطلوب منه </th>
                                            <th> العدد المطلوب </th>
                                            <th> </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if $refusedRequests }
                                        {assign var=i value=1}
                                        {foreach $refusedRequests as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td>{$data->productName}</td>
                                            <td>{$data->requestStoreName}</td>
                                            <td>{$data->storeName}</td>
                                            <td>{$data->productnoreq}</td>
                                            <td><button type="button" data-requestId="{$data->id}"
                                                    class="btn btn-primary seenBtn">تمت رؤيته</button></td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                        {/if}
                                    </tbody>
                                </table>
                                <button type="button" data-page="print_tab6_3" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                        <!-- end the  tabb -->

                    </div>
                </div>
                <!-- end the  tabaaa -->
                {/if}

                {if $loadData->productno == "0"}
                <div {if $DDD neq 1} class="tab-pane active" {else} class="tab-pane" {/if} id="info">
                    <!-- start the 1st tab -->
                    <div class="panel-body">
                        <form class="form-inline  hidden-print" action="noticesController.php?do=show" method="post">
                            <div class="form-group">
                                <label class="sr-only">اختر مخزن</label>
                                <select data-placeholder="اختر مخزن" class="select2 wdt300" name="supplierid"
                                    id="supplierid">
                                    <option value="-1"> اختر مخزن </option>
                                    {foreach $allstore as $newstorex}

                                    <option value="{$newstorex->storeId}" {if {$newstorex->storeId} eq
                                        {$storeid->storeId} }selected {/if}>{$newstorex->storeName}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <input type="hidden" name="get_storeid" value="{$storeid->storeId}" id="get_storeid" />
                            <div class="form-group">
                                <div class="col-md-2">

                                    <label class="sr-only">تصنيف المنتج</label>
                                </div>
                                <select class="select2 wdt300 productCat" data-level="0" name="productCatId0"
                                    id="productCatId0">
                                    <option value="-1">اختر تصنيف</option>
                                    {foreach $catDataReport as $data}
                                    <option value="{$data->productCatId}">{$data->productCatName}</option>
                                    {/foreach}
                                </select>
                                <input type="hidden" id="level" name="level" value="0">
                            </div>

                            <div class="form-group">
                                <div id="manyParents">

                                </div>
                            </div>
                            <button type="submit" id="submit1" class="btn btn-primary">بحث</button>
                        </form>
                    </div>
                    <div class="form-group propbd" id="DivIdToPrint">
                        <table class="table table-black">
                            <thead>
                                <tr>

                                    <th>اسم المنتج</th>
                                    <th> الكميه بالمخزن</th>
                                    <th> الحد الادنى </th>
                                </tr>
                            </thead>
                            <tbody>

                                {foreach $allproduct as $data}
                                <tr>

                                    <td>{$data->productName}</td>
                                    <td>{$data->productquantity}</td>
                                    <td>{$data->limitamount}</td>

                                </tr>

                                {/foreach}

                            </tbody>
                        </table>

                        <button type="button" data-page="print_tab1" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>
                    </div>
                </div><!-- end the 1st tab -->
                {/if}
                <!-- =================================================   -->
                {if $loadData->kempilano == "0"}
                <div class="tab-pane {if $allkempila } {else} hidden-print {/if}" id="props"><!-- start the 2nd tab -->

                    <div class="form-group">
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th> اسم العميل </th>
                                    <th> التاريخ</th>
                                    <th> القيمه </th>
                                    <th> طباعه </th>
                                </tr>
                            </thead>
                            <tbody>


                                {foreach $allkempila as $kempila}

                                <tr>
                                    <td>{$kempila->clientname}</td>
                                    <td>{$kempila->recievingdate}</td>
                                    <td>{$kempila->value}</td>
                                    <td class="hidden-print"><a
                                            href="noticesController.php?do=editprint&id={$kempila->id}" type="button"
                                            class="btn btn-default btn-lg printicon"> </a></td>

                                </tr>

                                {/foreach}

                            </tbody>
                        </table>
                        <button type="button" data-page="print_tab2" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>
                    </div>
                </div><!-- end the 2nd tab -->
                {/if}


                <!-- =================================================   -->
                {if $loadData->productnotsellno == "0"}
                <div {if $DDD eq 1} class="tab-pane active" {else} class="tab-pane" {/if} id="genpro">
                    <!-- start the 3rd tab -->
                    <div class="panel-body">
                        <form class="form-inline  hidden-print" action="noticesController.php?do=showproductnotsell"
                            method="post" name="xx">
                            <div class="form-group">
                                <label class="sr-only">اختر مخزن</label>
                                <select data-placeholder="اختر مخزن" class="select2 wdt300 " name="supplierid2"
                                    id="supplierid2">
                                    <option value="-1">اختر مخزن </option>
                                    {foreach $allstore as $store}
                                    <option value="{$store->storeId}" {if {$store->storeId} eq {$storeid2->storeId}
                                        }selected {/if}>{$store->storeName}</option>
                                    {/foreach}

                                </select>
                            </div>
                            <input type="hidden" name="get_storeid2" value="{$storeid2->storeId}" id="get_storeid2" />

                            <div class="form-group">
                                <div class="col-md-2">

                                    <label class="sr-only">تصنيف المنتج</label>
                                </div>
                                <select class="select2 wdt300 productCatt" data-level="0" name="productCattId0"
                                    id="productCattId0">
                                    <option value="-1">اختر تصنيف</option>
                                    {foreach $catDataReport as $data}
                                    <option value="{$data->productCatId}">{$data->productCatName}</option>
                                    {/foreach}
                                </select>
                                <input type="hidden" id="levelt" name="levelt" value="0">
                            </div>

                            <div class="form-group">
                                <div id="manyParentst">

                                </div>
                            </div>

                            <button type="submit" id="submit2" class="btn btn-primary">بحث</button>
                        </form>
                    </div>
                    <div class="form-group">
                        <table class="table table-black">
                            <thead>

                                <tr>

                                    <th>اسم المنتج</th>
                                    <th> الكميه بالمخزن</th>
                                    <th> الحد الادنى </th>
                                </tr>
                            </thead>
                            <tbody>


                                {foreach $allsell as $sell1}

                                <tr>

                                    <td>{$sell1->productName}</td>
                                    <td>{$sell1->productquantity}</td>
                                    <td>{$sell1->limitamount}</td>

                                </tr>

                                {/foreach}


                            </tbody>
                        </table>
                        <button type="button" data-page="print_tab3" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>

                    </div>
                </div><!-- end the 3rd tab -->
                {/if}
                <!-- =================================================   -->
                {if $loadData->clientcheckno == "0"}
                <div class="tab-pane {if $clientcheck } {else} hidden-print {/if}" id="check"><!-- start the 4th tab -->
                    <div class="form-group">
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th> اسم البنك </th>
                                    <th> اسم العميل </th>
                                    <th> التاريخ</th>
                                    <th> رقم الشيك </th>
                                    <th> القيمه </th>
                                    <th> طباعه </th>
                                </tr>
                            </thead>
                            <tbody>


                                {foreach $clientcheck as $check}

                                <tr>
                                    <td>{$check->bankName}</td>



                                    <td>

                                        {$check->clientname}

                                    </td>

                                    <td>{$check->dueDate}</td>
                                    <td>{$check->checkNo}</td>
                                    <td>{$check->checkValue}</td>
                                    <td class="hidden-print"><a
                                            href="noticesController.php?do=editprint2&checkid={$check->datedCheckedID}"
                                            type="button" class="btn btn-default btn-lg printicon"> </a></td>

                                </tr>

                                {/foreach}

                            </tbody>
                        </table>
                        <button type="button" data-page="print_tab4" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>

                    </div>
                </div><!-- end the 4th tab -->
                {/if}

                <!--**********************************************************************-->

                {if $loadData->suppliercheckno == "0"}
                <div class="tab-pane  {if $suppiercheck } {else} hidden-print {/if}" id="suppliercheck">
                    <!-- start the 5th tab -->
                    <div class="form-group">
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th> اسم البنك </th>
                                    <th> اسم المورد </th>
                                    <th> التاريخ</th>
                                    <th> رقم الشيك </th>
                                    <th> القيمه </th>
                                    <th>طباعه</th>
                                </tr>
                            </thead>
                            <tbody>


                                {foreach $suppiercheck as $checksupplier}

                                <tr>
                                    <td>{$checksupplier->bankName}</td>

                                    <td>
                                        {$checksupplier->suppliername}
                                    </td>

                                    <td>{$checksupplier->dueDate}</td>
                                    <td>{$checksupplier->checkNo}</td>
                                    <td>{$checksupplier->checkValue}</td>
                                    <td class="hidden-print"><a
                                            href="noticesController.php?do=editprint2&checkid={$checksupplier->datedCheckedID}"
                                            type="button" class="btn btn-default btn-lg printicon"> </a></td>

                                </tr>

                                {/foreach}

                            </tbody>
                        </table>
                        <button type="button" data-page="print_tab5" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>
                    </div>
                </div><!-- end the 5th tab -->
                {/if}



                <!-- start the  delayOptic -->
                {if $loadData->toWorkShopOrder == "0"}
                <div class="tab-pane {if $loadData->toWorkShopOrder eq 1} hidden {/if}" id="delayOptic">

                    <div class="form-group">
                        <table class="table dataTableClass table-black">
                            <thead>
                                <tr>
                                    <th>م</th>
                                    <th>رقم الطلبية</th>
                                    <th>النوع</th>
                                    <th class='hidden-print'>تفاصيل</th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=i value=1}
                                {foreach $delayGo as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>متأخرات ذهاب</td>
                                    <td class='hidden-print'>
                                        <a href="workshoptransport.php?do=orderdetails&id={$data->id}" target="_blank"
                                            type="button" class="btn btn-default btn-lg notesicon"></a>
                                    </td>
                                </tr>
                                {capture assign=i}{$i+1}{/capture}
                                {/foreach}

                                {foreach $delayWorkshop as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>متأخرات ورشة</td>
                                    <td class='hidden-print'>
                                        <a href="workshoptransport.php?do=orderdetails&id={$data->id}" target="_blank"
                                            type="button" class="btn btn-default btn-lg notesicon"></a>
                                    </td>
                                </tr>
                                {capture assign=i}{$i+1}{/capture}
                                {/foreach}

                                {foreach $delayBack as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>متأخرات عودة</td>
                                    <td class='hidden-print'>
                                        <a href="workshoptransport.php?do=orderdetails&id={$data->id}" target="_blank"
                                            type="button" class="btn btn-default btn-lg notesicon"></a>
                                    </td>
                                </tr>
                                {capture assign=i}{$i+1}{/capture}
                                {/foreach}
                            </tbody>
                        </table>
                        <button type="button" data-page="print_tab8" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>

                    </div>
                </div>
                {/if}
                <!-- end the  delayOptic -->


                <!-- start the  premium -->

                <div class="tab-pane" id="premium">

                    <div class="form-group">
                        <table class="table dataTableClass table-black">
                            <thead>
                                <tr>
                                    <th>م</th>
                                    <th>اسم العميل</th>
                                    <th>عدد الاقساط المتاخره</th>
                                    <th>اجمالي الاقساط المتاخره</th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=i value=1}
                                {foreach $premiums as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->clientname}</td>
                                    <td>{$data->totalLate}</td>
                                    <td>{$data->totalnotpayed - $data->totalRest}</td>
                                </tr>
                                {capture assign=i}{$i+1}{/capture}
                                {/foreach}
                            </tbody>
                        </table>
                        <button type="button" data-page="print_tab8" onclick='printDiv();'
                            class="btn print_btn btn-success pull-right">طباعة</button>

                    </div>
                </div>
                <!-- end the  premium -->


                <!-- start the  tabaaa -->
                {if $loadData->insuranceBill == "0"}
                <div class="tab-pane {if $loadData->insuranceBill eq 1} hidden {/if}" id="tabInsurance">

                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tabInsurancea" data-toggle="tab">طلبات تنتظر الموافقة</a></li>
                        <li><a href="#tabInsuranceb" data-toggle="tab"> طلبات تمت الموافقة عليها </a></li>
                        <li><a href="#tabInsurancec" data-toggle="tab"> طلبات تم رفضها </a></li>
                    </ul>

                    <div class="tab-content">
                        <!-- start the  tabn -->
                        <div class="tab-pane active" id="tabInsurancea">

                            <div class="form-group">
                                <table class="table table-black dataTableClass">
                                    <thead>
                                        <tr>
                                            <th>رقم المسلسل</th>
                                            <th>اسم العميل</th>
                                            <th>رقم الفاتورة</th>
                                            <th>إجمالي الفاتورة</th>
                                            <th>التاريخ</th>
                                            <th class="hidden-print">المستخدم</th>
                                            <th>مكان الاضافه </th>
                                            <th>شركة التأمين</th>
                                            <th class="hidden-print">الفرع</th>
                                            <th class="hidden-print">تفاصيل الفاتورة</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if count($waitBills) > 0}
                                        {assign var=i value=1}
                                        {foreach $waitBills as $data}
                                        <tr>
                                            <td>{$i}</td>
                                            <td> {$data->clientname} </td>
                                            <td>{$data->billno}</td>
                                            <td>{$data->finalnetbillvalue}</td>
                                            <td>{$data->billdate}</td>
                                            <td class="hidden-print">{$data->username}</td>
                                            <td>{if $data->offline == 1 }محليا {else} على السيرفر الرئيسى مباشرة {/if}
                                            </td>
                                            <td>{$data->insurancecompanyid}</td>
                                            <td class="hidden-print">{$data->branchid}</td>
                                            <td class="hidden-print"><a href="bills.php?do=details&id={$data->id}"
                                                    target="_blank" type="button"
                                                    class="btn btn-default btn-lg notesicon"></a></td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}

                                        {else}
                                        <tr>
                                            <td colspan="7" style="text-align: center;"><label>لا توجد بيانات </label>
                                            </td>
                                        </tr>

                                        {/if}
                                    </tbody>

                                </table>
                                <button type="button" data-page="print_tab9_1" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>

                            </div>
                        </div>
                        <!-- end the  tabn -->

                        <!-- start the  taba -->
                        <div class="tab-pane" id="tabInsuranceb">

                            <div class="form-group">
                                <table class="table table-black dataTableClass">
                                    <thead>
                                        <tr>
                                            <th>رقم المسلسل</th>
                                            <th>اسم العميل</th>
                                            <th>رقم الفاتورة</th>
                                            <th>إجمالي الفاتورة</th>
                                            <th>التاريخ</th>
                                            <th class="hidden-print">المستخدم</th>
                                            <th>مكان الاضافه </th>
                                            <th>شركة التأمين</th>
                                            <th class="hidden-print">الفرع</th>
                                            <th class="hidden-print">تفاصيل الفاتورة</th>
                                            <th class="hidden-print"></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if count($approvedBills) > 0}
                                        {assign var=i value=1}
                                        {foreach $approvedBills as $data}
                                        {if {$data->deleted} eq 1}
                                        <tr class="danger"> {elseif {$data->deleted} eq 0}
                                        <tr> {/if}
                                            <td>{$i}</td>
                                            <td> {$data->clientname} </td>
                                            <td>{$data->billno}</td>
                                            <td>{$data->finalnetbillvalue}</td>
                                            <td>{$data->billdate}</td>
                                            <td class="hidden-print">{$data->username}</td>
                                            <td>{if $data->offline == 1 }محليا {else} على السيرفر الرئيسى مباشرة {/if}
                                            </td>
                                            <td>{$data->insurancecompanyid}</td>
                                            <td class="hidden-print">{$data->branchid}</td>
                                            <td class="hidden-print"><a href="bills.php?do=details&id={$data->id}"
                                                    target="_blank" type="button"
                                                    class="btn btn-default btn-lg notesicon"></a></td>
                                            <td class="hidden-print"><button type="button" data-requestid="{$data->id}"
                                                    class="btn btn-primary seenBill">تمت رؤيته</button></td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}

                                        {else}
                                        <tr>
                                            <td colspan="7" style="text-align: center;"><label>لا توجد بيانات </label>
                                            </td>
                                        </tr>

                                        {/if}
                                    </tbody>

                                </table>
                                <button type="button" data-page="print_tab9_2" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>

                            </div>
                        </div>
                        <!-- end the  taba -->

                        <!-- start the  tabb -->
                        <div class="tab-pane" id="tabInsurancec">

                            <div class="form-group">
                                <table class="table table-black dataTableClass">
                                    <thead>
                                        <tr>
                                            <th>رقم المسلسل</th>
                                            <th>اسم العميل</th>
                                            <th>رقم الفاتورة</th>
                                            <th>إجمالي الفاتورة</th>
                                            <th>التاريخ</th>
                                            <th class="hidden-print">المستخدم</th>
                                            <th>مكان الاضافه </th>
                                            <th>شركة التأمين</th>
                                            <th class="hidden-print">الفرع</th>
                                            <th class="hidden-print">تفاصيل الفاتورة</th>
                                            <th class="hidden-print"></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {if count($rejectedBills) > 0}
                                        {assign var=i value=1}
                                        {foreach $rejectedBills as $data}
                                        {if {$data->deleted} eq 1}
                                        <tr class="danger"> {elseif {$data->deleted} eq 0}
                                        <tr> {/if}
                                            <td>{$i}</td>
                                            <td> {$data->clientname} </td>
                                            <td>{$data->billno}</td>
                                            <td>{$data->finalnetbillvalue}</td>
                                            <td>{$data->billdate}</td>
                                            <td class="hidden-print">{$data->username}</td>
                                            <td>{if $data->offline == 1 }محليا {else} على السيرفر الرئيسى مباشرة {/if}
                                            </td>
                                            <td>{$data->insurancecompanyid}</td>
                                            <td class="hidden-print">{$data->branchid}</td>
                                            <td class="hidden-print"><a href="bills.php?do=details&id={$data->id}"
                                                    target="_blank" type="button"
                                                    class="btn btn-default btn-lg notesicon"></a></td>
                                            <td class="hidden-print"><button type="button" data-requestid="{$data->id}"
                                                    class="btn btn-primary seenBill">تمت رؤيته</button></td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}

                                        {else}
                                        <tr>
                                            <td colspan="7" style="text-align: center;"><label>لا توجد بيانات </label>
                                            </td>
                                        </tr>

                                        {/if}
                                    </tbody>

                                </table>

                                <button type="button" data-page="print_tab9_3" onclick='printDiv();'
                                    class="btn print_btn btn-success pull-right">طباعة</button>

                            </div>
                        </div>
                        <!-- end the  tabb -->

                    </div>
                </div>
                {/if}
                <!-- end the  Insurance -->



            </div><!-- end of tabs -->
            <!--**********************************************************************-->


            <div class="clearfix"></div>
            <hr />
            <div class=" hidden-print">
                <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">طباعة</button>-->
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>

            </form>
        </div>
    </div>
</div>

{literal}
<script>
    $(document).ready(function (e) {
        $('.seenBtn').live('click', function (e) {
            var requestId = $(this).attr('data-requestId');
            var row = $(this).parent().parent();
            $.post('productrequestajax.php?do=seerequestnotice', { requestId: requestId }, function (rslt) {
                if (Number(rslt) == 1) {
                    row.remove();
                }
            });
        });

        $('.seenBill').live('click', function (e) {
            var requestId = $(this).attr('data-requestId');
            var row = $(this).parent().parent();
            $.post('billsajax.php?do=notifseen', { id: requestId }, function (rslt) {
                if (Number(rslt) == 1) {
                    row.remove();
                }
            });
        });

        $('.productCat').live('change', function () {
            var id = $(this).val();
            var level = Number($(this).attr('data-level'));
            level = level + 1;
            $('#level').val(level);
            $.post('noticesAjaxController.php?do=getsubcat', { id: id, level: level }, function (data) {
                $('.productCat').each(function () {
                    var thisLevel = Number($(this).attr('data-level'));
                    if (thisLevel >= level) {
                        $(this).parent('div').remove();
                    }
                });
                if (data != "-1") {
                    $('#manyParents').append(data);
                }
            });
        });

        $('.productCatt').live('change', function () {
            var id = $(this).val();
            var level = Number($(this).attr('data-level'));
            level = level + 1;
            $('#levelt').val(level);
            $.post('noticesAjaxController.php?do=getsubcat', { id: id, level: level, t: 1 }, function (data) {
                $('.productCatt').each(function () {
                    var thisLevel = Number($(this).attr('data-level'));
                    if (thisLevel >= level) {
                        $(this).parent('div').remove();
                    }
                });
                if (data != "-1") {
                    $('#manyParentst').append(data);
                }
            });
        });
    });

    function printDiv() {

        // var divToPrint=document.getElementById('DivIdToPrint');
        $('body').on('click', '.print_btn', function () {

            var tab = $(this).attr('data-page');
            var supplierid = $('#get_storeid').val();

            var supplierid2 = $('#get_storeid2').val();
            var userid = $('#userid').val();
            //  alert('tab = '+tab);
            $.post('noticesAjaxController.php?do=print_tab', { tab: tab, supplierid: supplierid, supplierid2: supplierid2, userid: userid }, function (data) {

                //  console.log(data);
                var newWin = window.open('', 'Print-Window');

                newWin.document.open();

                newWin.document.write('<html><body onload="window.print()">' + data + '</body></html>');

                newWin.document.close();

                setTimeout(function () { newWin.close(); }, 10);

            });


        });

        //        var newWin=window.open('','Print-Window');
        //
        //      newWin.document.open();
        //
        //      newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
        //
        //      newWin.document.close();
        //
        //      setTimeout(function(){newWin.close();},10);



    }


</script>
{/literal}