
<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="form-inline  hidden-print" action="productRecieveController.php?do=show" method="post">

                    <div class="form-group">
                        <select name="sparepartid" id="sparepartid" class="select2 wdt100" style="width:200px;" placeholder="إسم قطعة الغيار" onchange="this.form.submit();">
                            <option value="-1"></option>
                            {foreach $spareParts as $part}
                            <option value="{$part->sparepartid}">{$part->sparepartname}</option>
                            {/foreach}
                        </select>
                    </div>

                    <button type="submit" class="btn btn-primary noprint">بحث</button>
                </form>
                <!-- Table -->


                <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>التكلفة</th>
                                    <th>عدد القطع</th>
                                </tr>
                            </thead>
                            <tbody>

                                {foreach $productsData as $part}
                                <tr>
                                    <td>{$part->recieptnum}</td>
                                    <td>{$part->sparepartname}</td>
                                    <td>{$part->clientname}</td>
                                    <td>{$part->productrecievedate}</td>
                                    <td>{if $part->type eq 1}صيانة غير ضمان {else} صيانة ضمان{/if}</td>
                                    {if $part->type eq 1}
                                    <td>{$part->cost}</td>
                                    {else}
                                    <td>قطع الغيار مجانية</td>
                                    {/if}
                                    <td>{$part->partsnumber}</td>
                                </tr>
                                {/foreach}

                            </tbody>

                        </table>


                        <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 class="clearfix"></div>
                        <hr />
                    </div>
                </div>
                <div  class="noprint">
                    <div class="dataTables_info" id="datatable_2_info"> هناك &nbsp;[{$paginate.first}-{$paginate.last}]&nbsp; عنصر من &nbsp; &nbsp; [{$paginate.total}]</div>
                    <div class="dataTables_paginate paging_full_numbers" id="datatable_2_paginate"> {if {paginate_prev} eq ""}
                        {else} <span class="next paginate_button" id="datatable_2_next">{paginate_prev}</span> {/if} <span> {if {paginate_middle} eq ""}
                            {else} <span class="paginate_button">{paginate_middle format="page"}</span> {/if} </span> {if {paginate_next} eq ""}
                        {else} <span class="last paginate_button" id="datatable_2_last">{paginate_next}</span> {/if} </div>
                </div>
            </div>
        </div>
        {literal}
        {/literal}