<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
</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[78]->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="suppliersAndProductsReportController.php?do=all" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                    <div class="form-group">
                        <label class="sr-only">الموردين</label>
                        <select class="select2 wdt300"  name="supplierId" id="supplierId" >
                            <option value="-1">اختر مورد</option>

                            {foreach $suppliersData as $s}

                            <option value="{$s->supplierid}">{$s->suppliername} </option>

                            {/foreach}

                        </select>
                    </div>
                    <br/>
                    <div class="form-group">
                        <label class="sr-only">المنتجات</label>
                        <!--input type="hidden" class="select2product "  name="productId" id="productId" data-placeholder="اختر منتج"  /-->

                        <input type="hidden" class="select2product wdt300"  name="productId" id="productId" data-placeholder="اختر منتج"  />

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

            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}.{$productId}</div>
                <div class="panel-body">
                    <table class="table table-black dataTableClass">
                         <thead>
                            <tr>
                                <th>اسم  المورد</th>
                                <th>اسم المنتج</th>
                               <!--  <th>وحدة القياس</th> -->
                                <th>خصم البيع</th>
                                <th>الكميه الحاليه</th>
                                <th> العدد </th>
                                <th>سعر </th>
<!--                                 <th>نوع السعر</th>
 -->                                <th>التاريخ</th>
                                <th class="hidden-print">الفاتورة</th>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=i value=1}
                            {foreach $productIDS as $productId}
                            {foreach $dataArray_{$productId} as $arrayAlso}
                            {foreach $arrayAlso as $pro}
                            <tr {if $pro->billtypes eq 0} style="background: #85ff85" {elseif $pro->billtypes eq 1}  style="background: #9f9ffb" {else} style="background: #ff6868" {/if}>
                                   <td>{$pro->suppliername}</td>
                                <td>{$pro->productName}
                                    {if $hidecat eq 1}
                                    /{$pro->productCatName}
                                    {/if}</td>
                                <!-- <td>{$pro->unitName}</td> -->
                                <td>{$pro->discounts}</td>
                                <td>{$pro->productquantity}</td>
                                <td>{$pro->quantitys}</td>
                                <td>{$pro->buybilldetailprice}</td>
                                <!--          <td>{if $pro->pricetype eq 0}جملة {else}تجزئة{/if}</td>
                                -->          <td>{$pro->buybilldate}</td>

                                <td>
                                    {if $pro->billtypes eq 0}
                                    <a href="buyBillController.php?do=details&id={$pro->buybillid}" type="button" class="btn btn-default btn-lg notesicon" target="_blank"></a>
                                    {elseif $pro->billtypes eq 1}
                                    <a href="buyBillController.php?do=details&id={$pro->buybillid}" type="button" class="btn btn-default btn-lg notesicon" target="_blank"></a>
                                    {else}
                                    <a href="returnBuyBillController.php?do=details&id={$pro->buybillid}" type="button" class="btn btn-default btn-lg notesicon" target="_blank"></a>
                                    {/if}
                                </td>
                            </tr>
                            {/foreach}
                            {/foreach}
                            {capture assign=i}{$i+1}{/capture}
                            {/foreach}


                        </tbody>

                    </table>

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

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