$(document).ready(function(){
$("#select_discipline").live("change", function(event) {
var discipline = $("#select_discipline").val();
if (discipline == -1) {
$("#select_category").html('');
$("#select_legaue").html('');
$("#select_season").html('');
return;
}
$.ajax({
type: "POST",
data: "selected_discipline="+$("#select_discipline").val(),
dataType: "html",
url: base_url+"results/get_leagues",
success: function(data){
$("#select_legaue").html(data);
}
});
});
$("#select_legaue").live("change", function(event) {
var discipline = $("#select_discipline").val();
if (discipline == -1) {
$("#select_category").html('');
$("#select_season").html('');
return;
}
$.ajax({
type: "POST",
data: "selected_discipline="+$("#select_discipline").val()+"&selected_legaue="+$("#select_legaue").val(),
dataType: "html",
url: base_url+"results/get_seasons",
success: function(data){
$("#select_season").html(data);
}
});
});
$("#select_season").live("change", function(event) {
var discipline = $("#select_discipline").val();
if (discipline == -1) {
$("#select_category").html('');
return;
}
$.ajax({
type: "POST",
data: "selected_discipline="+$("#select_discipline").val()+"&selected_legaue="+$("#select_legaue").val()+"&selected_season="+$("#select_season").val(),
dataType: "html",
url: base_url+"results/get_categories",
success: function(data){
$("#select_category").html(data);
}
});
});
$("#select_category").live("change", function(event) {
$.ajax({
type: "POST",
data: "selected_legaue="+$("#select_legaue").val()+"&selected_discipline="+$("#select_discipline").val()+"&selected_season="+$("#select_season").val()+"&selected_category="+$("#select_category").val()+"&ajax=1",
dataType: "html",
url: base_url+"results/score",
success: function(data){
$('#results_all').html(data);
}
});
});
});