
<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">
            <div class="panel-heading">
                <h3 class="panel-title">تعديل قطع غيار</h3>
            </div>
            <div class="panel-body"> {literal}
                <form class="nameToBeChecked form-horizontal" role="form" action="sparePartController.php?do=update" method="post" onsubmit="if (Spry.Widget.Form.validate(this)) {
                            checkNameWithId(event, 'sparepart', 'sparepartname', 'sparepartid');
                            return true;
                        } else {
                            return false;
                        }">
                    {/literal}
                    <input name="sparepartid" id="sparepartid" type="hidden" value="{$loadData->sparepartid}" />

                    <div class="form-group">
                        <label for="storeName" class="col-lg-2 control-label">إسم القطعة</label>
                        <div class="col-lg-4"> <span id="name">
                                <input type="text" name="sparepartname" id="sparepartname"   placeholder="إسم القطعة" value="{$loadData->sparepartname}"  class="form-control" />
                                <span class="textfieldRequiredMsg">*</span></span>
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الاسم مستخدم من قبل</p>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="storeDescription" class="col-lg-2 control-label">التكلفة</label>
                        <div class="col-lg-4"><span id="sprytextfield1">
                                <input type="text" name="sparepartprice" id="sparepartprice" class="form-control"  value="{$loadData->sparepartprice}" />
                                <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">*</span></span></div>
                    </div>

                    <!-- =================================================   -->

                    <div class="form-group">
                        <label for="storeDescription" class="col-lg-2 control-label">عدد القطع في المخزن</label>
                        <div class="col-lg-4"><span id="sprytextfield2">
                                <input type="text" name="partquantity" id="partquantity" class="form-control" value="{$loadData->partquantity}"/>
                                <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">*</span></span>

                            <input name="h_partquantity" id="h_partquantity" type="hidden"  value="{$loadData->partquantity}"/>
                        </div>
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="storeDescription" class="col-lg-2 control-label">ملاحظات</label>
                        <div class="col-lg-4">
                            <textarea  class="form-control" rows="3" name="sparepartnotes">{$loadData->sparepartnotes}</textarea>
                        </div>
                    </div>

                    <!-- =================================================   -->

                    <div class="form-group">
                        <label class="col-lg-2 control-label">إيقاف</label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>  <input value="1" {if {$loadData->
                                    conditions} eq 1} checked {/if} name="delete" type="radio" />
                                    نعم</label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="0" {if {$loadData->
                                    conditions} eq 0} checked {/if} name="delete" type="radio" />
                                    لا</label>
                            </div>
                        </div>
                    </div>

                    <!--==============================-->

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit"  class="btn btn-primary pull-left">حفظ</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{literal}
<script type="text/javascript">
    var name = new Spry.Widget.ValidationTextField("name");
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "integer");
</script>
{/literal}
