<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المناقصات</a></li>
            <li><a href="tenderAnnouncementController.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" accept-charset="UTF-8" role="form" action="tenderAnnouncementController.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="announcementSide" class="col-lg-2 control-label"> الجهة</label>
                        <div class="col-lg-4"> <span id="sprytextfield1">
                                <input type="text" name="side" id="side" class="form-control">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementActivity" class="col-lg-2 control-label"> النشاط</label>
                        <div class="col-lg-4"> <span id="sprytextfield3">
                                <input type="text" name="activity" id="activity" 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-4">
                            <span>
                                <select name="status" id="status" data-placeholder="اختر " class="select2 wdt100">
                                    <option value="-1">اختر</option>
                                    <option value="process">جاري البت فيها</option>
                                    <option value="avilable">يمكن التقدم لها</option>
                                    <option value="done">تم اصدار امر التوريد لها</option>
                                    <option value="paused">تم ايقاف العملية</option>
                                    <option value="canceled">تم الغاء العملية</option>
                                </select>
                            </span>
                        </div>
                    </div>


                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementSubDate" class="col-lg-2 control-label"> تاريخ التقديم</label>
                        <div class="col-lg-4"> <span id="sprytextfield2">
                                <input type="date" name="subdate" id="subdate" >
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementOpeningDate" class="col-lg-2 control-label"> تاريخ فتح المظاريف</label>
                        <div class="col-lg-4"> <span id="sprytextfield4">
                                <input type="date" name="openingdate" id="openingdate">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementAnnouceDate" class="col-lg-2 control-label"> تاريخ الاعلان</label>
                        <div class="col-lg-4"> <span id="sprytextfield2">
                                <input type="date" name="annoucedate" id="annoucedate">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementInsurance" class="col-lg-2 control-label"> التأمين الابتدائي</label>
                        <div class="col-lg-4"> <span id="sprytextfield2">
                                <input type="number" name="insurance" id="insurance" class="form-control">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementBigPrice" class="col-lg-2 control-label"> سعر كراسة الشروط للشركات الكبيرة</label>
                        <div class="col-lg-4"> <span id="sprytextfield2">
                                <input type="number" name="bigprice" id="bigprice" class="form-control">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcementTinyPrice" class="col-lg-2 control-label"> سعر كراسة الشروط للشركات الصغيرة ومتناهية الصغر</label>
                        <div class="col-lg-4"> <span id="sprytextfield2">
                                <input type="number" name="tinyprice" id="tinyprice" 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-4">
                            <span>
                                <select name="nature" id="nature" data-placeholder="اختر " class="select2 wdt100">
                                    <option value="-1">اختر</option>
                                    <option value="internal">داخلية</option>
                                    <option value="external">خارجية</option>
                                    <option value="other">اخري</option>
                                </select>
                            </span>
                            <div id="other_input_container" style="display: none; margin-top: 10px;">
                                <input type="text" name="other_nature" id="other_nature" class="form-control" placeholder="طبيعة العملية">
                            </div>
                        </div>
                    </div>

                    <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">نوع العملية </label>
                        <div class="col-lg-4">
                            <span>
                                <select name="type" id="type" data-placeholder="اختر " class="select2 wdt100">
                                    <option value="public tender">مناقصة عامة</option>
                                    <option value="limeted tender">مناقصة محدودة</option>
                                    <option value="general practice">ممارسة عامة</option>
                                    <option value="local tender">مناقصة محلية</option>
                                </select>
                            </span>
                        </div>
                    </div>
                    <!--==============================-->
                        <div class="form-group">
                        <label for="announcementEvaluation" class="col-lg-2 control-label">نظام التقييم</label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="evaluation" id="evaluation0" class="radioR" value="0" checked>
                                    مقبول </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="evaluation" id="evaluation1" class="radioR" value="1">
                                    مرفوض </label>
                            </div>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <!--==============================-->
                        <div class="form-group">
                        <label for="announcementAcceptretial" class="col-lg-2 control-label">تقبل التجزئة</label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="accept" id="accept0" class="radioR" value="0" checked>
                                    نعم </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="accept" id="accept1" class="radioR" value="1">
                                    لا </label>
                            </div>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="announcementOffers" class="col-lg-2 control-label">توجد عروض بديلة</label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="offers" id="offers0" class="radioR" value="0" checked>
                                    نعم </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="offers" id="offers1" class="radioR" value="1">
                                    لا </label>
                            </div>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="announcmentDescription"
                               class="col-lg-2 control-label">الوصف</label>
                        <div class="col-lg-10">
                            <textarea class="form-control " rows="3" name="description"></textarea>
                        </div>
                    </div>
                    <!--==============================-->


                    <div class="form-group">
                        <label for="announcmentTerms"
                               class="col-lg-2 control-label"> الشروط</label>
                        <div class="col-lg-10">
                            <textarea class="form-control " rows="3" name="terms"></textarea>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label for="announcmentNotes"
                               class="col-lg-2 control-label"> الملاحظات</label>
                        <div class="col-lg-10">
                            <textarea class="form-control " rows="3" name="notes"></textarea>
                        </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('');
        }
    });
});

</script>
{/literal}