
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المنتجات</a></li>
            <li><a href="sparePartController.php?do=show">قطع الغيار</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">
                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <p id="outputStringValue">{$outputString}</p>
                    <div class="clearfix"></div>
                </div>
            </div>

            <!-- Table -->
            {literal}
            <form method="post" action="sparePartController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                        return countChoosenProducts('sparePartController');
                    } else {
                        return false;
                    }">
                {/literal}
                <table class="table table-black">
                    <thead>
                        <tr>
                            <th class="hidden-print">
                                <input type="checkbox" name="checkAll" id="checkAll"/>
                            </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>

                        {foreach $sparePartsData as $part}
                        {if {$part->conditions} eq 1}
                        <tr class="danger"> {elseif {$part->conditions} eq 0}

                        <tr> {/if}
                            <td class="hidden-print">
                                <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$part->sparepartid}" />
                            </td>
                            <td>{$part->sparepartname}</td>
                            <td>{$part->sparepartprice}</td>
                            <td>{$part->sparepartprice}</td>
                            <td class="hidden-print"> <a href="sparePartController.php?do=edit&id={$part->sparepartid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                            <td class="hidden-print"> {if {$part->conditions} eq 1} <a href="sparePartController.php?do=returndelete&id={$part->sparepartid}" type="button" class="btn btn-default btn-lg correcticon"></a> {elseif {$part->conditions} eq 0} <a href="sparePartController.php?do=deletetemp&id={$part->sparepartid}" type="button" class="btn btn-default btn-lg removeicon"></a> {/if} </td>
                            <!--<td> <a href="#" name="dd" type="button" class="btn btn-default btn-lg deleteicon conformdel1" data-position="sparePartController.php?do=delete&id={$part->sparepartid}" ></a> </td>-->
                        </tr>
                        {/foreach}

                    </tbody>

                </table>
                <div class="clearfix"></div>
                <hr />
                <div  class="hidden-print">
                    <div class="col-lg-12">
                        <div class="well well-sm">
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <label for="operation"></label>
                                    <span id="spryselect1">
                                        <select name="operation" id="operation"  data-placeholder="اختر العملية" class="select2 wdt100">
                                            <option value="-1">اختر عملية</option>
                                            <option value="1">ايقاف</option>
                                            <option value="2">تشغيل </option>
                                            <!-- <option value="3">حذف </option>-->
                                        </select>
                                        <span class="selectInvalidMsg">*</span></span></div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <input name=""  class="hidden-print btn btn-primary" type="submit" value="تنفيذ"/>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div id="noElementsError" class="alert alert-danger fade in" style="display:none;">
                                <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">×</button>
                                <p>يجب اختيار العناصر أولاً</p>
                                <div class="clearfix"></div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <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>
            </form>
        </div>

        <div  class="hidden-print">
            <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}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
</script>
{/literal}