<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">طلبات التقديم</a></li>
            <li><a href="bidRequest.php?do=report">تقرير</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="bidRequest.php?do=report"
                      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-4">
                            <span>
                                <select name="member_id" disabled id="member_id"  data-placeholder="اختر العملية" class="select2 wdt100">
                                    <option value="-1">اختر العضو</option>
                                    {foreach $allMembers as $member}
                                        <option value="{$member->id}" {if $showData->member_id == $member->id}selected{/if}>{$member->member_name}</option>
                                    {/foreach}
                                </select>
                            </span>
                        </div>
                    </div>
                        <!--==============================-->
                  <div class="form-group">
                        <label class="col-lg-2 control-label">العملية</label>
                        <div class="col-lg-4">
                            <span>
                                <select name="name" disabled id="name"  data-placeholder="اختر العملية" class="select2 wdt100">
                                    <option value="-1">اختر العملية</option>
                                    {foreach $tenders as $tender}
                                        <option value="{$tender->id}" data-side="{$tender->the_issuing_entity}" {if $tender->id == $showData->op_id}selected{/if}>{$tender->name}</option>
                                    {/foreach}
                                </select>
                            </span>
                        </div>
                    </div>
                        <!--==============================-->

                    <div class="form-group">
                        <label for="requestdate" class="col-lg-2 control-label"> تاريخ الجلسة</label>
                        <div class="col-lg-4"> <span id="sprytextfield3">
                                <input type="date" readonly name="session" id="session" value="{$showData->session_date}">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                      <!--==============================-->
                    <div class="form-group">
                        <label for="announcementSide" class="col-lg-2 control-label">الجهة</label>
                        <div class="col-lg-4">
                            <input type="text" disabled name="side" id="side" class="form-control" value="{R::load('tenderannouncement', $showData->op_id)->the_issuing_entity}" readonly />
                        </div>
                    </div>
                     <!--==============================-->
                      <div class="form-group">
                        <label class="col-lg-2 control-label">صورة الطلب</label>
                        <div class="col-lg-4">
                            {if $showData->image != "" && $showData->image !="." &&
                            $showData->image !="no image"}
                            <img src="../upload/bidRequest/{$showData->image}" alt="" width="122" height="75" />
                            {/if}
                            
                            <input type="hidden" name="imageurl" id="imageurl" value="{$showData->image}" />
                        </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);
        }
    });
    $(document).ready(function(){
    $('#name').on('change', function() {
        let sideValue = $(this).find('option:selected').data('side');
        if (sideValue) {
                $('#side').val(sideValue);
            } else {
                $('#side').val(''); 
            }
        });
})
</script>
{/literal}