

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

        <ol class="breadcrumb">
            <li><a href="#">العملاء</a></li>
            <li><a href="closingAccountController.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="form-horizontal"  role="form" action="closingAccountController.php?do=save" method="post" id="spform">
                    {/literal}


                     <div class="form-group"  >
                        <label  class="col-lg-2 control-label">العملاء </label>
                        <div class="col-lg-4">
                            <input type="text" name="client_id" required="" class="searchdata wdt100" id="select2client" data-placeholder="اختر " />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">  تاريخ الاغلاق     </label>
                        <div class="col-lg-4">
                           <input type="text" class="form-control awdatepicker searchdata" required="" autocomplete="off"   data-date-format="yyyy-mm-dd" name="date_close" id="start_date" value="{$date}">
                            
                        </div>
                    </div>
                    
                    
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit"   class="btn btn-primary pull-left">حفظ  </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>






{literal}
<script type="text/javascript">
$(document).ready(function () {
        var formatResult;
        formatResult = function (data) {return  data.text;}
          



         $("#select2client").select2({
            placeholder: "إسم  المشروع",
            multiple: false,
            quietMillis: 100,
            ajax: {
                url: "closingAccountController.php?do=select2client",
                type: "post",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        searchTerm: term,
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: formatResult,
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });




    
});  
</script>
{/literal}
