<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المناقصات</a></li>
            <li><a href="receivefinalletter.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="receivefinalletter.php?do=update"
                      method="post" enctype="multipart/form-data" id="spform">
                    {/literal}
                    <!-- =================================================   -->
                   <div class="form-group">
                        <label class="col-lg-2 control-label">العملية</label>
                        <div class="col-lg-9">
                            <select name="request" id="request" class="select2" required>
                                {foreach $relatedInfo as $info}
                                    <option value="{$info.notes_id_val}" {if $showData->receive_id_val == $info.notes_id_val}selected{/if}>
                                    العضو: {$info.member_name} |
                                    العملية: {$info.tender_name} |
                                    الجهة: {$info.the_issuing_entity}
                                    
                                    </option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                     <!--==============================-->
                    <div class="form-group">
                        <label for="comment" class="col-lg-2 control-label">تعليق</label>
                        <div class="col-lg-9">
                            <textarea name="comment" id="comment" class="form-control" rows="3">{$showData->comment}</textarea>
                        </div>
                    </div>
                    
                    <!--==============================-->
                      <div class="form-group">
                        <label class="col-lg-2 control-label"> مرفقات</label>
                        <div class="col-lg-4">
                            {if $showData->receive_files != "" && $showData->receive_files !="." &&
                            $showData->receive_files !="no image"}
                            <div style="margin-bottom: 10px;">
                            {assign var="imgs" value=","|explode:trim($showData->receive_files)}
                            {foreach $imgs as $img}
                                <img src="../upload/receivefinalletter/{trim($img)}" width="80" height="60" style="border:1px solid #ccc; margin-left:5px;" />
                                
                            {/foreach}
                            </div>
                            {/if}
                            <input type="file" name="image[]" id="image" multiple accept=".jpg, .jpeg, .png, .pdf"/>
                            <input type="hidden" name="imageurl" id="imageurl" value="{$showData->receive_files}" />
                        </div>
                    </div>
                <!--==============================-->
                    <input name="id" id="id" type="hidden" value="{$showData->id}" />

                    <!-- =================================================   -->
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" class="btn btn-primary pull-left" id="spbutton">حفظ</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{literal}
<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    $('#spbutton').live('click', function (e) {
        if (!$('#spbutton').hasClass("processing")) {
            $('#spbutton').addClass("processing");
            $('#productCatName').trigger('blur');
            setTimeout(function () {
                var myForm = document.getElementById("spform");
                var SS = Spry.Widget.Form.validate(myForm);
                if (SS == true) {
                    myForm.submit();
                } else {
                    $('#spbutton').removeClass("processing");
                }
            }, 500);
        }
    });
</script>
{/literal}