<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    .mHead{
        color: #002bff ;
        font-weight: bold !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">تقرير عملاء ومنتجات
                <a href="{$youtubes[76]->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="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" style="margin-left: 13px;">العملاء</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="" />-->
                        <input type="hidden" class="select2product wdt300"  name="productId" id="productId" data-placeholder="اختر منتج" />

                        <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" >
                    </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" >
                    </div>
                    <button type="submit" class="searchBtn btn btn-primary">بحث</button>
                    <!--<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 mHead">{$message}</div>
                <div class="panel-body">
                    <hr/>
                    <table class="table table-black" id="mTable">
                        <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>

                            {foreach $alldata 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->clientname}</td>

                                <td>{$pro->productName}
                                    {if $hidecat eq 1}
                                    /{$pro->productCatName}
                                    {/if}</td>

                                <!-- <td>{if {$pro->unitName} neq ''} {$pro->unitName} {else} --- {/if}</td> -->
                                 <td>{$pro->discounts}</td>
                                 <td>{$pro->productquantity}</td>
                                <td>{$pro->quantitys}</td>
                                <td>{$pro->prices}</td>
                                <td>{if $pro->pricetypes eq 0}جملة {elseif $pro->pricetypes eq 1}تجزئة {else} نصف جملة{/if} </td>
                                <td>{$pro->dates}</td>

                                <td class="hidden-print">

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

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

                                     {elseif {$pro->billtypes} eq 4}
                                    <a href="returnsellbillController.php?do=showDetail&returnsellbillid={$pro->ids}" type="button" class="btn btn-default btn-lg notesicon" target="_blank"></a>

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