<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">نظام الجمعيات</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="form-horizontal" action="subventionController.php" id="charityformajax" method="post"
                    enctype="multipart/form-data" data-dosave="?do=savedata">
                    {/literal}
                    <div class="form-group">
                        <label class="col-lg-2 control-label">الجمعية </label>
                        <div class="col-lg-4">
                            <select name="charity_id" id="charity_id" data-placeholder="اختر " class="selectnew"
                                required data-table="subvention" data-tablecol="charity_id">
                                <option value=""></option>
                                {foreach $allCharities as $single}
                                <option value="{$single.id}">{$single.charityname}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <hr />
                    <div id="BeneficiariesDiv"></div>


                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" class="btn btn-primary pull-left charityformajax">حفظ الامر</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="Modalguarantee_type_id" tabindex="-1" role="dialog"
    aria-labelledby="Modalguarantee_type_idLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="Modalguarantee_type_idLabel"> اضافة </h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="subventionController.php" id="formguarantee_type" method="post"
                    enctype="multipart/form-data" data-dosave="?do=saveguarantee_type" data-direction="">
                    <div class="form-group">
                        <label for="name" class="col-form-label"> نوع الكفالة</label>
                        <input required="required" type="text" name="name" class="form-control checkcolumn"
                            placeholder=" نوع الكفالة" data-table="guaranteetype" data-tablecol="name"
                            data-filter=" name = ? " data-tableid="" data-parentid="" data-parentcol="" />
                    </div>

                    <input id="popguaranteetype" type="hidden" name="guarantee_type_id" value="" />
                    <input id="itrguaranteetype" type="hidden" name="selectitr" value="" />

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
                <button type="button" class="btn btn-primary saveformajax" data-action="0"
                    data-form="formguarantee_type">
                    حفظ</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        selectedit();
    });
</script>