<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">نظام الجمعيات</a></li>
            <li><a href="beneficiariesController.php?do=show">عرض المستفيدين</a></li>
            <li class="active">بحث</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title">بحث</h3>
            </div>
            <div class="panel-body">
                <form class="form-horizontal" role="form" action="beneficiariesController.php?do=getcharity"
                    method="post" enctype="multipart/form-data">
                    <div class="panel panel-default">

                        <div class="form-group">
                            <label class="col-lg-2 control-label">الرقم القومي </label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" id="idNo" />
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-8">
                                <button class="btn btn-primary" id="searchBtn">بحث</button>
                            </div>
                        </div>
                        <hr />
                        <div class="clearfix"></div>
                        <div id="charityNameDiv" class="alert alert-success fade in" style="display:none;">


                        </div>

                </form>

            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>

{literal}
<script>
    $('#searchBtn').on('click', function (e) {
        e.preventDefault();
        let idNo = $('#idNo').val();
        $.post('beneficiariesController.php?do=getBenData', { idno: idNo }, function (data) {
            if (data != -1) {
                $('#charityNameDiv').show();
                $('#charityNameDiv').html(data);
            }
        });
    })
</script>
{/literal}