<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">اجتماع مجلس الادارة</a></li>
            <li><a href="meetingdate.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="meetingdate.php?do=add"
                      method="post" enctype="multipart/form-data" id="spform">
                    {/literal}

                    
                    

                    
                    <div class="form-group">
                        <label for="notes" class="col-lg-2 control-label"> تاريخ الاجتماع</label>
                        <div class="col-lg-4">
                            <input type="date" name="date" id="date" class="form-control">
                        </div>
                      
                    </div>
                    <!--==============================-->
                     <div class="form-group">
                        <label for="notes" class="col-lg-2 control-label"> وقت البداية</label>
                        <div class="col-lg-4">
                            <input type="time" name="time" id="time" class="form-control">
                        </div>
                      
                    </div>
                    <!--==============================-->

                    <div class="form-group">
                        <label for="place" class="col-lg-2 control-label">مكان الانعقاد</label>
                        <div class="col-lg-4">
                           <input type="text" name="place" id="place" class="form-control">
                        </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="type" value="normal" checked> عادي
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="type" value="emergency"> طارىء
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="type" value="periodic"> دوري
                                        </label>
                                       
                                    </div>
                                </div>
                    <!--==============================-->

                    <div class="form-group">
                        <label for="court_decision" class="col-lg-2 control-label">موضوع الاجتماع</label>
                        <div class="col-lg-4"><span id="sprytextfield1">
                            <span>
                            <textarea name="comment" id="comment" class="form-control" rows="4" required></textarea>
                            <span class="textfieldRequiredMsg">*</span></span>
                        </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  accept=".jpg, .jpeg, .png, .pdf" />
                        </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() {
    $(document).on('input', '.opponent-input', function() {
        let currentInput = $(this);
        let parentRow = currentInput.closest('.opponent-row');
        let nextRow = parentRow.next('.opponent-row');
        if (currentInput.val().trim() !== "") {
            nextRow.show(); 
        } else {
            if(nextRow.find('input').val() === "") {
             nextRow.hide(); 
            }
        }
    });
});

</script>
{/literal}