

$(document).ready(function () {
    
    $('#total_classe').html('<i class="fa fa-spinner fa-spin"></i>');
    $('#total_tooo').html('<i class="fa fa-spinner fa-spin"></i>');
    // var campus = $("#autoSizingSelect option:selected").val();
    var instutition = $(".abba_display_campus option:selected").val();

    var userID = $('#user_id').val();

       

     // $("#ekene_select_assignment_campus").val(campus);
   $('#ekene_select_progressreport_class').html('<option>  <span class="visually-hidden">Loading...</span></option>'); 
    
   $.ajax({
       type: "POST",
       url: "../../controller/scripts/admin/assignment/ekene_select_class.php",
       data: {
         
             campus: instutition
          
       },
   
       success: function (output) { 
           
          
           $("#ekene_select_progressreport_class").html(output);
   
       }
   });

   $.ajax({
       type: "POST",
       url: "../../controller/scripts/admin/assignment/ekene_select_termalias.php",
       data: {
       
             campus: instutition
          
       },
   
       success: function (output) { 
           
          
           $("#ekene_select_progressreport_term").html(output);
   
       }
   });

});



    $('#progressbutton').on('click', function() {
        // Redirect to the specified URL when the button is clicked
        window.location.href = '../../../../learningfieldschool.edumess.com/admin/progressreport/index.php';
    });



$('body').on('click', '#ekene_progress_report_load', function () {
    
    var instutition = $(".abba_display_campus option:selected").data("id");

    var userID = $('#user_id').val();
    var class_id = $("#ekene_select_progressreport_class").val();
    var campus = $(".abba_display_campus").val();
    var termid = $("#ekene_select_progressreport_term").val();
    
    $('#ekene_progressreport_filter').html('<div class="text-center p-5 "> <span class="spinner-border spinner-border-lg" role="status" aria-hidden="true" style="color:#007ffb;"></span></div>');
    

    $.ajax({
                type: "POST",
                url: "../../controller/scripts/admin/progressreport/ekene_select_progressreport_subject.php",
                data: {
                    class_id: class_id,
                    userID: userID,
                    termid: termid,
                    instutition:instutition,
                      campus: campus
                   
                },
            
                success: function (output) { 
                  
                
                    $("#ekene_progressreport_filter").html(output);
            
                }
            });
            

            $.ajax({
                type: "POST",
                url: "../../controller/scripts/admin/progressreport/ekene_display_totaltopic.php",
                data: {
                    class_id: class_id,
                    userID: userID,
                    termid: termid,
                    instutition:instutition,
                      campus: campus
                   
                },
            
                success: function (output) { 
                  
                
                    $("#total_tooo").html(output);
            
                }
            });



            $.ajax({
                type: "POST",
                url: "../../controller/scripts/admin/progressreport/ekene_display_totalsubmittedtopic.php",
                data: {
                    class_id: class_id,
                    userID: userID,
                    termid: termid,
                    instutition:instutition,
                      campus: campus
                   
                },
            
                success: function (output) { 
                  
                
                    $("#total_classe").html(output);
            
                }
            });


        
});





$('body').on('click','#view_progressreporticon',function(){
    
   $("#ekene_progress_report3").modal("show");
    var view_subjectid = $(this).data("id");
    var class_id = $("#ekene_select_progressreport_class").val();
    var campus = $(".abba_display_campus").val();
    var termid = $("#ekene_select_progressreport_term").val();

    $.ajax({
        type: "POST",
        url: "../../controller/scripts/admin/progressreport/ekene_select_topic.php",
        data: {
            campus: campus,
            classid: class_id,
            term: termid,
              subject: view_subjectid
           
        },
    
        success: function (output) { 
            
            $("#display_progress_reporttwo").html(output);
    
        }
    });


});







// $('body').on('click', '#emma_load_assignment_question', function () {
//     var subject = $('#emma_display_section_for_display_subject option:selected').val();
//     var campus = $('#emma_display_section_for_display_campus option:selected').val();
//     var classid = $('#emma_display_section_for_display_class option:selected').val();
//     var term = $('#emma_display_section_for_display_term option:selected').val();


//     $.ajax({
//         type: "POST",
//         url: "../../controller/scripts/Teacher/progressreport/ekene_select_topic.php",
//         data: {
//             campus: campus,
//             classid: classid,
//             term: term,
//               subject: subject
           
//         },
    
//         success: function (output) { 
          
           
//             $("#display_progress_report").html(output);
    
//         }
//     });

// });

