$('.placement input,#ff_45_education,#ff_45_dropdown').on("change",function(){
var education=$("#ff_45_education").val();
var level=$("#ff_45_dropdown").val();
var placement=$('.placement input:checked').val();
$.ajax({
url:"/getcoursedetails/",
type:"POST",
data:{education:education,level:level,placement:placement},
success:function(response)
{
function getcommaseparated(x)
{
x=x.toString();
var lastThree = x.substring(x.length-3);
var otherNumbers = x.substring(0,x.length-3);
if(otherNumbers != '')
lastThree = ',' + lastThree;
var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
return res;
}
gst=0;
$('.courseamout').text(getcommaseparated(response));
amount=response*1;
gst=amount*0.18;
$(".gst").text(getcommaseparated(gst));
$(".ff_product_price_label").text("₹");
$("#ff_45_custom-payment-amount").val(amount+gst);
$("#ff_45_payment_input").val((amount+gst));
$("#ff_45_payment_input").attr("data-payment_value",(amount+gst));
}
});
});
/** Expertise Amout **/
$(document).ready(function(){
$(".quantity").css("visibility","hidden");
$("#ff_45_item-quantity").val("1");
$(".totalamount").attr("readonly",true);
function getcommaseparated(x)
{
x=x.toString();
var lastThree = x.substring(x.length-3);
var otherNumbers = x.substring(0,x.length-3);
if(otherNumbers != '')
lastThree = ',' + lastThree;
var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
return res;
}
$("#ff_45_multi_select").on("change",function(){
// $('.courseamout,.gst,.ff_product_price').text("0");
if($(this).val()!="")
{
var Expertise=$(this).val().length;
var amount=100000*Expertise;
$('.courseamout').text(getcommaseparated(amount));
var gst=amount*0.18;
$(".gst").text(getcommaseparated(gst));
$("#ff_45_custom-payment-amount").val(amount+gst);
$("#ff_45_payment_input").val((amount+gst));
$("#ff_45_payment_input").attr("data-payment_value",(amount+gst));
}
});
$(".courses").hide();
$(".level").on("change",function(){
$(".courses").hide();
if($(this).val()=="expertise")
$(".courses").show();
});
});