$(document).ready(function(){
  
  $('.bankdetail_createbtn').click(function(){
	  $("#bankdetail_create").modal('show');
	}); 
 
  $('.bankd_submit').click(function(){ 
    
    var bank_aliasname=$('#bankd_aliasname').val();
    var bank_name=$('#bankd_bankname').val();
    var bank_branchname=$('#bankd_branchname').val();
    var bank_ifsc=$('#bankd_ifsc').val();
    var ac_no=$('#bankd_acno').val();
 
    if(bank_aliasname==''||bank_name==''||bank_branchname==''||bank_ifsc==''||ac_no=='')
    {
      alert("Please Enter All bank Details !!...");
    }
    else
    {   
      $.ajaxSetup({
        headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
      });  
      $.ajax({
        url:url_bankdetailstore,
        type:"POST",
        data:{
          bank_aliasname:bank_aliasname,
          bank_name:bank_name,
          bank_branchname:bank_branchname,
          bank_ifsc:bank_ifsc,
          ac_no:ac_no,
        },
        success:function(data){          
          $("#bankdetail_create").modal('hide');  
          var success="";
          success=success+
          '<p style="text-align:center;"><b>Bank Detail Created Successfully!!!</b></p>'; 
          $('#bankdetail_success').append(success);
          $('#bankdetail_success').removeClass("hide");
          setTimeout(function(){
            location.reload();
          }, 200);        
    }
  });
}
  });

});