<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">تقرير عملاء ومنتجات</div>
            <div class="panel-body">
                <form class="searchForm form-inline hidden-print" action="clientsAndProductsReportController.php?do=show" 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="clientId" id="clientId" required>
                            <option value="-1">اختر عميل</option>

                            {foreach $clientsData as $c}

                            <option value="{$c->clientid}">{$c->clientname} </option>

                            {/foreach}

                        </select>
                        <div class="clientError" style="display:none;"></div>
                    </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="اختر منتج"  required="" />
                        <div class="productError" style="display:none;"></div>

                    </div>
                    <br />
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="dateStart form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" required>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="dateEnd form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" required>
                    </div>
                    <button type="button" class="searchBtn btn btn-primary">بحث</button>
                    <div class="dateStartError" style="display:none;"></div>
                    <div class="dateEndError" style="display:none;"></div>

                </form>
            </div>

            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                <div class="panel-body">
                    <hr/>
                    <table class="table table-black">
                        <thead>
                            <tr>
                                <th>اسم المنتج</th>
                                <th>وحدة القياس</th>
                                <th>سعر البيع</th>
                                <!--            <th>نوع السعر</th>
                                -->            <th>التاريخ</th>
                                <th class="hidden-print">الفاتورة</th>
                            </tr>
                        </thead>
                        <tbody>

                            {assign var=i value=1}
                            {foreach $alldata{$i} as $pro}
                            <tr>
                                <td>{$pro->productName}
                                    {if $hidecat eq 1}
                                    /{$pro->productCatName}
                                    {/if}</td>

                                <td>{if {$pro->unitName} neq ''} {$pro->unitName} {else} --- {/if}</td>
                                <td>{$pro->sellbilldetailprice}</td>
                                <!--          <td>{if $pro->pricetype eq 0}جملة {else}تجزئة{/if}</td>
                                -->          <td>{$pro->sellbilldetaildate}</td>

                                <td class="hidden-print">

                                    {if {$pro->billtype} eq 2}
                                    <a href="bills.php?do=details&id={$pro->id}" type="button" class="btn btn-default btn-lg notesicon"></a>
                                    {elseif {$pro->billtype} eq 3 }
                                    <a href="billsreturn.php?do=details&id={$pro->id}" type="button" class="btn btn-default btn-lg notesicon"></a>
                                    {elseif {$pro->billtype} eq 0}
                                    <a href="sellbillController.php?do=showDetail&sellbillid={$pro->sellbillid}" type="button" class="btn btn-default btn-lg notesicon"></a>

                                    {elseif {$pro->billtype} eq 1}
                                    <a href="sellbillandruternController.php?do=showDetail&sellbillid={$pro->sellbillid}" type="button" class="btn btn-default btn-lg notesicon"></a>

                                    {/if}
                                </td>
                            </tr>
                            {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>
