<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    @media print {
        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, 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
        }
    }
</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 -->
            {if $message != ""}
            <div class="panel-heading">{$message}
                <a href="{$youtubes[69]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>

            {else}
            <div class="panel-heading">تقرير منتج بالباركود
                <a href="{$youtubes[69]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>
            {/if}
            <div class="panel-body">
                <form class="form-inline hidden-print" action="productserailreportController.php?do=show" method="post">
                    <div class="form-group"><span id="spryselect1">
                            <label class="sr-only">الباركود
                                <select class="select2 wdt300"  name="productserailid" id="productserailid" >
                                    <option value="-1">اختر الباركود</option>





                                    {foreach $allproductserail as $myallproductserail}






                                    <option value="{$myallproductserail->productserailid}">{$myallproductserail->serialnumber}__{$myallproductserail->productName} </option>





                                    {/foreach}





                                </select>
                            </label>
                            <span class="selectInvalidMsg">اختر منتج.</span></span></div>
                    <br/>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            {if {count($productdata)} > 0}
            <hr/>
            <table class="table table-black">
                <thead>
                    <tr>
                        <th>اسم المنتج</th>
                        <th>السريال</th>
                        <th>الكميه</th>
                        <th>تاريخ البدايه</th>
                        <th>تاريخ النهايه</th>
                        <th>الايام المتبقية</th>
                        <th class="hidden-print">فاتوره الشراء</th>
                        <th class="hidden-print">فاتوره البيع</th>
                        <th class="hidden-print">حذف</th>
                    </tr>
                </thead>
                <tbody>

                    {assign var=i value=1}
                    {foreach $productdata as $product}

                    {if {$product->del} eq 1}
                    <tr class="danger"> {elseif {$product->del} eq 0}

                    <tr> {/if}
                        <td>{$product->productName}</td>
                        <td>{$product->serialnumber}</td>
                        <td>
                            {if {$product->soldsellbillid} > 0}
                            {$product->quantity}
                            {else}
                            {$product->don}
                            {/if}</td>
                        <td>{$product->startdate}</td>
                        <td>{$product->enddate}</td>
                        <td {if $product->diff <= 0}style="background-color: #f97c7c"{/if}>{$product->diff}</td>
                        <td class="hidden-print"> {if {$product->type} eq 0} <a href="buyBillController.php?do=details&id={$product->billid}" type="button" class="btn btn-default btn-lg editicon"></a> {else} <a href="buyAndReturnBillController.php?do=details&id={$product->billid}" type="button" class="btn btn-default btn-lg editicon"></a> {/if} </td>
                        <td class="hidden-print"> {if {$product->soldsellbillid} > 0}

                            {if {$product->sellbilltype} eq 0}
                            <a href="sellbillController.php?do=showDetail&sellbillid={$product->soldsellbillid}" type="button" class="btn btn-default btn-lg editicon" target="_blank"></a>
                            {else}
                            <a href="sellbillandruternController.php?do=showDetail&sellbillid={$product->soldsellbillid}" type="button" class="btn btn-default btn-lg editicon"  target="_blank"></a>
                            {/if}
                            {else}
                            لم يتم بيعه
                            {/if} </td>
                        <td  class="hidden-print"> {if {$product->del} eq 0} <a href="productserailreportController.php?do=tempdelete&id={$product->productserailid}&del=1"  type="button" class="btn btn-default btn-lg removeicon"> </a> {elseif {$product->del} eq 1 } <a href="productserailreportController.php?do=tempdelete&id={$product->productserailid}&del=0"  type="button" class="btn btn-default btn-lg removeicon"> </a> {/if} </td>
                    </tr>
                    {capture assign=i}{$i+1}{/capture}
                    {/foreach}

                </tbody>

            </table>
            {if $i > 1}
            <div class="col-lg-4 ">
                <div class="well well-sm">
                    <h4 class="text-center">الكمية فى المخزن:  {$productdata[0]->don}</h4>
                </div>
            </div>
            {/if}
            {/if}
            <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>
        </div>
    </div>
</div>
{literal}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
</script>
{/literal}