<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">شئون قانونية</a></li>
            <li><a href="lawyers.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="lawyers.php?do=add"
                      method="post" enctype="multipart/form-data" id="spform">
                    {/literal}

                    <!-- =================================================   -->
                 <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" name="name" id="name" class="form-control" />
                                <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="number" name="phone" id="phone" class="form-control" />
                                <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="text" name="address" id="address" class="form-control" />
                                <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="number" name="etihadnum" id="etihadnum" class="form-control" />
                                <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="number" name="national" id="national" class="form-control" />
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                   
                    <!--==============================-->
                    
                     <!--==============================-->
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">درجة القيد</label>
                                    <div class="col-lg-6">
                                        <label class="radio-inline">
                                            <input type="radio" name="status" value="primary" checked> ابتدائي 
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="status" value="appeal"> استئناف
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="status" value="cassation"> نقض
                                        </label>
                                    </div>
                                </div>
                                <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> صورة الكارنيه</label>
                        <div class="col-lg-4">
                            <input type="file" name="image[]" id="image" multiple />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> بطاقة الرقم القومي</label>
                        <div class="col-lg-4">
                            <input type="file" name="idimg[]" id="idimg" multiple />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">صورة شخصية</label>
                        <div class="col-lg-4">
                            <input type="file" name="yourimg" id="yourimg" />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <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");
            var myForm = document.getElementById("spform");
            var SS = Spry.Widget.Form.validate(myForm);
            if (SS == true) {
                myForm.submit();
            } else {
                $('#spbutton').removeClass("processing");
            }
        }
    });
$(document).ready(function() {
    $('#nature').on('change', function() {
        if ($(this).val() === 'other') {
            $('#other_input_container').show();
        } else {
            $('#other_input_container').hide(); 
            $('#other_nature').val(''); 
        }
    });
});
$(document).ready(function(){
    $('#name').on('change', function() {
        let sideValue = $(this).find(':selected').data('side');
        if (sideValue) {
                $('#side').val(sideValue);
            } else {
                $('#side').val(''); 
            }
        });
})
</script>
{/literal}