$(document).ready(function () {

    $("body").on("blur", ".memno, .sonno, .fathno, .dauno", getDetail);
    // $("body").on("keyup blur", ".fathno", getCal);

    function getDetail() {
        var memno = $(".memno").val(),
            sonno = $(".sonno").val(),
            fathno = $(".fathno").val(),
            dauno = $(".dauno").val();

        $.ajax({
            type: "POST",
            dataType: "json",
            url: "getpermarriage.php",
            data: {memno : memno, sonno : sonno, fathno : fathno, dauno : dauno},
            success: function (response) {
                if (response != "") {
                    var memname = response.memname,
                        sonname = response.sonname,
                        fathname = response.fathname,
                        dauname = response.dauname,
                        sagai = response.sagai,
                        lagan = response.lagan;
                        
                    $('.memname').val(memname);
                    $('.sagaiamt').val(sagai);
                    $('.laganamt').val(lagan);
                    $('.sonname').val(sonname);
                    $('.fathname').val(fathname);
                    $('.dauname').val(dauname);
                  
               
                }
            },
            error: function (_request, _textStatus, _errorThrown) {
            }
        });


        var totamt = parseFloat($(".sagaiamt").val()) + parseFloat($(".sagaiamt").val());
        $('.totamt').val(totamt);
    }




    // function getCal() {
        // var totamt = parseFloat($(".sonamt").val()) + parseFloat($(".dauamt").val());
        // $('.totamt').val(totamt);
    
    // }

//   alert(new Date($.now()));

// new Date($.now());

// var dt = new Date();
// var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds();
// // document.write(time);
// $('.engtime').val(time);





});