


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

        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <a href="bankaccountController.php?do=show">حسابات البنوك</a>
            <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">

                <form class="form-horizontal" role="form" action="bankAccountDeficitKindController.php?do=add" method="post"  id="spform">
                    <div class="form-group">
                        <label for="accountnumberDis" class="col-lg-2 control-label">العنوان</label>
                        <div class="col-lg-4">
                            <input name="accountmovementkindname" type="text"  class="form-control" placeholder="الاسم" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">التعليق</label>
                        <div class="col-lg-4">
                                <textarea rows="2" class="form-control" name="accountmovementkindcomment" placeholder="تعليق"></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>
<script type="text/javascript">
    
$(document).ready(function(){
     $('body').on('change', '#changetype,#changeamount', function () {
        var accountbeginingbalanceDis = Number($('#accountbeginingbalanceDis').val());
        var changetype = $('#changetype').val();
        var changeamount =Number($('#changeamount').val());
        if (changetype == 1) {
             $('#total').val(Number(accountbeginingbalanceDis - changeamount).toFixed(2));
        }else{
            $('#total').val(Number(accountbeginingbalanceDis + changeamount).toFixed(2));

        }
    });

});
</script>



{literal}
<script type="text/javascript">

    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue: "-1"});
    // var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "integer", {minValue: "1"});
    var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue: "-1"});
    var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {invalidValue: "-1"});
    function loadAccount(bankid)
    {
        spryselect2.destroy();
        $('#accountName').html('<img src="images/loader.gif/>');
        $('#accountName').load('getallaccountajax.php?do=getAccountdata&bankid=' + bankid + '', function (response, status, xhr) {
            var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue: "-1"});
            $("#accountid").select2();
        });
    }
    function loadAccountnumber(accountid)
    {
        $('#accountnumber').html('<img src="images/loader.gif/>');
        $('#accountnumber').load('getallaccountajax.php?do=getAccountnumber&accountid=' + accountid + '', function (response, status, xhr) {
        });
    }
    $('#spbutton').live('click', function (e) {
        var myForm = document.getElementById("spform");
        var SS = Spry.Widget.Form.validate(myForm);
        //console.log(SS);
        if (SS == true) {
            if (!$('#spbutton').hasClass("processing"))
            {
                $('#spbutton').addClass("processing");
                myForm.submit();
                $('#spbutton').attr("disabled", true);

            }
        }

    });
</script>
{/literal}
