<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>
<script src="{$path}/SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
<script src="{$path}/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="{$path}/SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css">
<link href="{$path}/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
<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[152]->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[152]->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=showvalidity" method="post">
                    <div class="form-group">
                        <label class="sr-only">عدد الايام</label>
                        <span id="sprytextfield1">
                            <input name="daynumber" type="text" class="form-control" id="daynumber" value="{$Programsettingdata->productDays}">
                            <span class="textfieldRequiredMsg">ادخل عدد الايام.</span><span class="textfieldInvalidFormatMsg">ادخل رقم صحيح.</span></span> </div>
                    <div class="form-group">
                        <label class="sr-only">اختر الشرط</label>
                        <span id="spryselect1">
                            <select class="select2"  name="condition" id="condition" >
                                <option value="-1">اختر الشرط</option>
                                <option value=">">اكبر من </option>
                                <option value="<">اصغر  من </option>
                                <option value="="> يساوى </option>
                            </select>
                            <span class="selectInvalidMsg">اختر الشرط.</span><span class="selectRequiredMsg">اختر الشرط.</span></span>
                    </div>
                    <br>
                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                    <div class="form-group">
                        <label class="sr-only">المنتج</label>

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


                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            {if {count($productsData)} > 0}
            <hr/>
            <table class="table table-black">
                <thead>
                    <tr>
                        <th>اسم المنتج</th>
                        <th>السريال</th>
                        <th>الكميه المتبقيه</th>
                        <th>تاريخ البدايه</th>
                        <th>تاريخ النهايه</th>
                        <th>الحاله</th>
                        <th>عدد الايام المتبقيه</th>
                    </tr>
                </thead>
                <tbody>

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

                    {*if ({$product->different}  <  6 && {$product->don} <> 1 && {$product->del} eq 0)  || {$product->expireDate} eq 0*}
                    {if (({$product->different}  <  6 || {$product->don} < 1 )&& {$product->del} eq 0)  }
                    <tr class="danger">

                        {elseif {$product->del} eq 1}
                    <tr bgcolor="#98BDD3">
                        {else}
                    <tr>
                        {/if}
                        <td>{$product->productName}</td>

                        <td>{$product->serialnumber}</td>
                        <td>{$product->don}</td>
                        <td>{$product->startdate}</td>
                        <td>{$product->enddate}</td>
                        <td> {if {$product->don} eq  0}
                            تم بيعه
                            {else}
                            لم يتم بيعه
                            {/if} </td>
                        <td>
                            {*if {$product->expireDate} eq 0*}
                            <!--                            0-->
                            {*else*}
                            {*$product->different*}
                            {*/if*}
                            {$product->different}
                        </td>
                    </tr>
                    {capture assign=i}{$i+1}{/capture}
                    {/foreach}

                </tbody>

            </table>
            {/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 sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue: "-1"});

</script>
{/literal}