'; $('#tableResultPres').html(table); $('#table_result').show(1000); }, cache: false, complete: () => { $('#table_showLoading5').hide(); } }); } else if (el_type_id !== '' && el_cat_id == '2') { } else if (el_type_id !== '' && el_cat_id == '3') { } else if (el_type_id !== '' && el_cat_id == '4') { } else if (el_type_id !== '' && el_cat_id == '5') { } else if (el_type_id !== '' && el_cat_id == '6') { } }); $('#sel_year').change(function () { $('#submitButton').show(500); }); let typeTxt; $('#sel_type').change(function () { typeTxt = this.value; $('#el_state').hide(); $('#el_zone').hide(); $('#el_const').hide(); $('#el_lga').hide(); $('#el_sha').hide(); $('#el_year').hide(); let dataString = 'id=' + typeTxt; if (typeTxt == 1) { $('#loader_year_img').show(); $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/year.php", data: dataString, cache: false, success: function (html) { $("#sel_year").html(html); $('#el_year').show(); $('#loader_year_img').hide(); }, error: function (xhr, status, error) { } }) } else { $('#el_state').hide(); $('#loader_state_img').show(); $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/states.php", data: dataString, cache: false, success: function (html) { $("#sel_state").html(html); $('#el_state').show(); $('#loader_state_img').hide(); }, error: function (xhr, status, error) { } }) } }); $('#sel_state').change(function () { let stateTxt = this.value; $('#el_year').hide(); $('#el_zone').hide(); $('#el_const').hide(); if (typeTxt == '2') { $('#el_year').hide(); $('#el_zone').hide(); $('#el_const').hide(); $('#loader_district_img').show(); let dataString = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/zones.php", data: dataString, cache: false, success: function (html) { $('#el_zone').show(); $('#loader_district_img').hide(); $("#sel_zone").html(html); }, error: function (xhr, status, error) { } }); } if (typeTxt == '3') { $('#loader_const_img').show(); let dataStrings = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/rep.php", data: dataStrings, cache: false, success: function (html) { $('#el_zone').hide(); $('#loader_const_img').hide(); $("#sel_const").html(html); $('#el_const').show(); }, error: function (xhr, status, error) { } }); } if (typeTxt == '4') { $('#el_year').hide(); $('#el_zone').hide(); $('#el_const').hide(); $('#loader_year_img').show(); let dataStrings4 = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/years.php", data: dataStrings4, cache: false, success: function (html) { $("#sel_year").html(html); $('#el_zone').hide(); $('#loader_year_img').hide(); $('#el_year').show(); }, error: function (xhr, status, error) { } }); } if (typeTxt == '6') { $('#el_year').hide(); $('#el_zone').hide(); $('#el_const').hide(); $('#loader_lga_img').show(); let dataStringss = 'id=' + stateTxt; // alert (dataStringss); $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/lgas.php", data: dataStringss, cache: false, success: function (html) { $("#sel_lga").html(html); $('#loader_lga_img').hide(); $('#el_lga').show(); }, error: function (xhr, status, error) { } }); } if (typeTxt == '5') { $('#el_year').hide(); $('#el_zone').hide(); $('#el_lga').hide(); $('#el_sha').hide(); $('#el_const').hide(); $('#loader_stateconst_img').show(); let dataStringsss = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/sha.php", data: dataStringsss, cache: false, success: function (html) { $('#loader_stateconst_img').hide(); $("#sel_sha").html(html); $('#el_sha').show(); }, error: function (xhr, status, error) { } }); } }); $('#sel_zone').change(function () { //$('#el_ra').show(); $('#el_year').hide(); $('#el_const').hide(); $('#el_lga').hide(); $('#el_sha').hide(); $('#loader_year_img').show(); let stateTxt = this.value; let dataString = 'id=' + stateTxt; // alert (dataString); $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/years.php", data: dataString, cache: false, success: function (html) { $("#sel_year").html(html); $('#loader_year_img').hide(); $('#el_year').show(); }, error: function (xhr, status, error) { alert(xhr.responseText); } }); }); $('#sel_const').change(function () { //$('#el_ra').show(); $('#el_year').hide(); $('#el_zone').hide(); $('#el_lga').hide(); $('#el_sha').hide(); $('#loader_year_img').show(); let stateTxt = this.value; let dataString = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/years.php", data: dataString, cache: false, success: function (html) { $("#sel_year").html(html); $('#loader_year_img').hide(); $('#el_year').show(); }, error: function (xhr, status, error) { alert(xhr.responseText); } }); }); $('#sel_sha').change(function () { //$('#el_ra').show(); $('#el_year').hide(); $('#el_zone').hide(); $('#el_lga').hide(); $('#el_const').hide(); $('#loader_year_img').show(); let stateTxt = this.value; let dataString = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/years.php", data: dataString, cache: false, success: function (html) { $("#sel_year").html(html); $('#loader_year_img').hide(); $('#el_year').show(); }, error: function (xhr, status, error) { alert(xhr.responseText); } }); }); $('#sel_lga').change(function () { //$('#el_ra').show(); $('#el_year').hide(); $('#el_zone').hide(); $('#el_sha').hide(); $('#el_const').hide(); $('#loader_year_img').show(); let stateTxt = this.value; let dataString = 'id=' + stateTxt; $.ajax({ type: "POST", url: "/wp-content/themes/independent-national-electoral-commission/custom/views/years.php", data: dataString, cache: false, success: function (html) { $("#sel_year").html(html); $('#loader_year_img').hide(); $('#el_year').show(); }, error: function (xhr, status, error) { alert(xhr.responseText); } }); }); })