<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">الشئون الادارية</a></li>
            <li><a href="outcomereport.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="outcomereport.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-6" style="padding-top: 7px;">
                            <label style="font-weight: normal; margin-right: 15px;">
                                <input type="radio" disabled name="type" value="in" {if $showData->type == in}checked{/if}>وارد 
                            </label>
                            
                            <label style="font-weight: normal; margin-right: 15px;">
                                <input type="radio" disabled name="type" value="out" {if $showData->type == out}checked{/if}>صادر 
                            </label>
    
                        </div>
                    </div>
                    <!--==============================-->
                                <div class="form-group">
                                    <label for="announcementName" class="col-lg-2 control-label">رقم الصادر</label>
                                    <div class="col-lg-4"> <span id="sprytextfield1">
                                            <input type="text" readonly name="ord" id="ord" class="form-control" value="{$showData->ord_num}" />
                                            <span class="textfieldRequiredMsg">*</span></span>
                                    </div>
                                </div>
                    <!-- =================================================   -->
                     <div class="form-group">
                                    <label for="announcementName" class="col-lg-2 control-label">التاريخ</label>
                                    <div class="col-lg-4"> <span id="sprytextfield1">
                                            <input type="date" readonly name="date" id="date" class="form-control" value="{$showData->date}" />
                                            <span class="textfieldRequiredMsg">*</span></span>
                                    </div>
                                </div>
                                <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">الادارة</label>
                        <div class="col-lg-4">
                            <span>
                                <select name="adminstration" disabled id="adminstration" data-placeholder="اختر الادارة" class="select2 wdt100">
                                    <option value="-1">اختر الادارة</option>
                                    {foreach $administrations as $administration}
                                        <option value="{$administration.id}" {if $showData.adminstration == $administration.id }selected{/if} >{$administration.administration}</option>
                                    {/foreach}
                                </select>
                            </span>
                        </div>
                    </div>
                        <!--==============================-->
                         <div class="form-group" >
                                    <label for="announcementName" class="col-lg-2 control-label" >الجهة المصدر اليها </label>
                                    <div class="col-lg-4"> <span id="sprytextfield1">
                                            <input type="text" readonly name="inside" id="inside" class="form-control" value="{$showData->inside}" />
                                            <span class="textfieldRequiredMsg">*</span></span>
                                    </div>
                                </div>
                                <!--==============================-->
                      <div class="form-group" >
                        <label for="announcementName" class="col-lg-2 control-label" >الموضوع</label>
                        <div class="col-lg-4"> <span id="sprytextfield1">
                               <select name="subject" disabled id="subject" data-placeholder="اختر الموضوع" class="select2 wdt100">
                                            <option value="-1">اختر الموضوع</option>
                                            <option value="other">اخري</option>
                                                {foreach $subjects as $subject}
                                                    <option value="{$subject.subject}" {if $showData->subject == $subject.subject }selected{/if} >{$subject.subject}</option>
                                                {/foreach}
                                </select>            
                            </span>
                        </div>
                    </div>
                    <!--==============================-->
                                  <div class="form-group" >
                        <label for="announcementName" class="col-lg-2 control-label" >المستلم</label>
                        <div class="col-lg-4"> <span id="sprytextfield1">
                                <select name="receiver" id="receiver" disabled data-placeholder="اختر المستلم" class="select2 wdt100">
                                            <option value="-1">اختر المستلم</option>
                                            <option value="other">اخري</option>
                                                {foreach $allNames as $subject}
                                                    <option value="{$subject.name}" {if $showData->receiver == $subject.name }selected{/if} >{$subject.name}</option>
                                                {/foreach}
                                </select>            
                            </span>
                        </div>
                    </div>
                     <!--==============================-->
                      
                                 
                      <div class="form-group">
                        <label for="announcementName" class="col-lg-2 control-label">ملاحظات</label>
                        <div class="col-lg-4"> <span id="sprytextfield1">
                                <input type="text" readonly name="comment" id="comment" class="form-control"  value="{$showData->comment}"  />
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                      <div class="form-group">
                        <label class="col-lg-2 control-label">مرفقات</label>
                        <div class="col-lg-4">
                            {if $showData->images != "" && $showData->images !="." &&
                            $showData->images !="no image"}
                            <div style="margin-bottom: 10px;">
                            {assign var="imgs" value=","|explode:trim($showData->images)}
                            {foreach $imgs as $img}
                                <img src="../upload/outandin/{trim($img)}" width="80" height="60" style="border:1px solid #ccc; margin-left:5px;" />
                                
                            {/foreach}
                            </div>
                            {/if}
                            
                            <input type="hidden" name="imageurl" id="imageurl" value="{$showData->images}" />
                        </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}