

  function move_bank(transfer_code,amt,url_bank,meth,user_id,wallet_balance,ba_na,an,ac_number,ro_no) {
  url2 = "../include/wit/check_amt.php";
  url3 = "../include/wit/check_code.php";



  //checked for Insufficient balance 
  $.ajax({
    type: "POST",
    url : url2,
    data: {amt:amt},
    success: function(data, request, settings){
    
      data == "errorbal" ?
        swal({
        text: " An Error as occured due to Insufficient Balance. Please Deposit and try again",
        icon: "error"
        }) //this is the end of the swal icon 

      :
      // first request for transfer code ... 
      swal({
        text: 'Enter Transfer code',
        content: "input",
        icon: 'warning',
        button: true,
      })

      .then((value) => { 
        value != transfer_code ?
          swal({
            text: "Error! Incorrect Transfer Code. Please Contact your Administrator",
            icon: "error"
          }) 
          // end swal
        :

        // now we check if the code already have been used 

        $.ajax({
          type: "POST",
          url : url3,
          data: {transfer_code:transfer_code},
          success: function(data, request, settings){

            if(data == 'errorCode'){
              swal({
              text: " An Error as occured due to an Invalid code (Transfer code). Please Contact your Administrator",
              icon: "error"
              }) //this is the end of the swal icon

            }else{

            
              var elem = document.getElementById("myBar");   
              var width = 5;
              var id = setInterval(frame, 150);
              // now we will bring the progress bar 
              
              function frame() {
                width >= 100 ? clearInterval(id) //clearing the width if the lenght is up to 100
                :
                width++; 
                elem.style.width = width + '%'; 
                elem.innerHTML = width * 1  + '%';

                // now we will call the Ajax code to call the main function code

                $.ajax({
                    type: "POST",
                    url: url_bank,
                    data: {amt: amt,transfer_code:transfer_code,meth:meth,user_id:user_id,wallet_balance:wallet_balance,ba_na:ba_na,an:an,ac_number:ac_number,ro_no:ro_no},
                    success: function(data,request,setting){

                      

                       $('#submit').prop('disabled',true);
                         if(data == "success"){
                         
                          var elem = document.getElementById("myBar"); 

                          var id = setInterval(frame, 60);
                          
                        }
                        // exit();
                    },
                    beforeSend: function(data,request,setting){
                      document.getElementById("pw").style.display = "block"; // this will hide the progress bar
                    }
                  });  //end ajax for bit coin 

                
                if( width == 100){
                  document.getElementById("pro_hide").style.display = "none"; // this will hide the progress bar
                  document.getElementById("pw").style.display = "none"; 

                  swal({
                  text: " Success! Your withdraw has been placed and its now in progress...",
                  icon: "success"
                  }) //this is the end of the swal icon
                                    
                  }

              }
              // end if for function frame

                
            }
            

            
          
          }
          // end if statement for If the transfer code have been used 

        });
        // end ajax function 

        

       })
      // end for the transfer code value

      
    }
    // end success from ajax function 
   
  });
  // end ajax function that will checks balance



} //end function move

