function get_plan(accountnumber,operator_id){
if(accountnumber.length==10){
if(operator_id>0){
$.ajax({
  type: 'POST',
  headers: {csrf:$('meta[name="csrf"]').attr('content')},
  url: "ajaxprocess",
  data: {get_plan:true,accountnumber:accountnumber,operator_id:operator_id},
  beforeSend: function() {
    $("#planbtn").html('<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span> Loading...').attr("disabled", true);
    $("#response").html("").hide();
  },

  success: function(response){
    if(response.status==true){
    $("#planbtn").html('Check Plans').attr("disabled", false);
    $("#response").html(response.html).show();
    }else{
    alert(response.message);
    $("#planbtn").html('Check Plans').attr("disabled", false);
    $("#response").html("").hide();
    }

    
  },

  error: function(xhr) {
    alert("Connection Error");
    $("#planbtn").html('Check Plans').attr("disabled", false);
    $("#response").html("").hide();
  }

});
}else{
alert("Please Select Operator");  
}

}else{
alert("Please Enter Mobile Number");  
}

} 


function get_roffer(accountnumber,operator_id){
if(accountnumber.length==10){
if(operator_id>0){
$.ajax({
  type: 'POST',
  url: "ajaxprocess",
  headers: {csrf:$('meta[name="csrf"]').attr('content')},
  data: {get_roffer:true,accountnumber:accountnumber,operator_id:operator_id},
  beforeSend: function() {
    $("#planbtn").html('<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span> Loading...').attr("disabled", true);
    $("#response").html("").hide();
  },

  success: function(response){
    if(response.status==true){
    $("#planbtn").html('Check Plans').attr("disabled", false);
    $("#response").html(response.html).show();
    }else{
    alert(response.message);
    $("#planbtn").html('Check Plans').attr("disabled", false);
    $("#response").html("").hide();
    }

    
  },

  error: function(xhr) {
    alert("Connection Error");
    $("#planbtn").html('Check Plans').attr("disabled", false);
    $("#response").html("").hide();
  }

});
}else{
alert("Please Select Operator");  
}

}else{
alert("Please Enter Mobile Number");  
}

} 


function pickAmt(amount,amtid,description,decsid){
document.getElementById(amtid).value = amount; 
document.getElementById(decsid).innerHTML = description;
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
} 




function get_customer_info(accountnumber,operator_id){
if(accountnumber.length>0){
if(operator_id>0){
$.ajax({
  type: 'POST',
  url: "ajaxprocess",
  headers: {csrf:$('meta[name="csrf"]').attr('content')},
  data: {get_customer_info:true,accountnumber:accountnumber,operator_id:operator_id},
  beforeSend: function() {
    $("#planbtn").html('<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span> Loading...').attr("disabled", true);
    $("#response").html("").hide();
  },

  success: function(response){
    if(response.status==true){
    $("#planbtn").html('Customer Info').attr("disabled", false);
    $("#response").html(response.html).show();
    }else{
    alert(response.message);
    $("#planbtn").html('Customer Info').attr("disabled", false);
    $("#response").html("").hide();
    }

    
  },

  error: function(xhr) {
    alert("Connection Error");
    $("#planbtn").html('Customer Info').attr("disabled", false);
    $("#response").html("").hide();
  }

});
}else{
alert("Please Select Operator");  
}

}else{
alert("Please Enter Customer ID");  
}

} 



function get_operator(accountnumber){

if(accountnumber.length==10){
$.ajax({
  type: 'POST',
  url: "ajaxprocess",
  headers: {csrf:$('meta[name="csrf"]').attr('content')},
  data: {get_operator:true,accountnumber:accountnumber},
  beforeSend: function() {
    $("#operator_id").attr("disabled", true);
  },

  success: function(response){
    
    if(response.status==true){
    $("#operator_id").val(response.operator_id).attr("disabled", false);
    }else{
    alert(response.message);
    $("#operator_id").attr("disabled", false);
    }

  },error: function(xhr) {
    alert("Connection Error");
    $("#operator_id").attr("disabled", false);
  }

});

}

}