<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from akademi.dexignlab.com/codeigniter/demo/student by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Mar 2024 10:51:33 GMT -->
<!-- Added by HTTrack -->
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->

<head>
    <!-- Title -->
    <title>Exam Schedule</title>
    <!-- Meta -->



</head>

<body>

    <div class="content-body">
        <!-- row -->
        <div class="container-fluid">
            <!-- Row -->
            <div class="row">
                <div class="col-xl-12">
                    <div class="row">
                        <div class="col-xl-12">
                            <div class="page-title flex-wrap">
                                <div class="input-group search-area mb-md-0 mb-3">
                                    <input type="text" class="form-control" placeholder="Search here...">
                                    <span class="input-group-text"><a href="javascript:void(0)">
                                            <svg width="15" height="15" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path d="M17.5605 15.4395L13.7527 11.6317C14.5395 10.446 15 9.02625 15 7.5C15 3.3645 11.6355 0 7.5 0C3.3645 0 0 3.3645 0 7.5C0 11.6355 3.3645 15 7.5 15C9.02625 15 10.446 14.5395 11.6317 13.7527L15.4395 17.5605C16.0245 18.1462 16.9755 18.1462 17.5605 17.5605C18.1462 16.9747 18.1462 16.0252 17.5605 15.4395V15.4395ZM2.25 7.5C2.25 4.605 4.605 2.25 7.5 2.25C10.395 2.25 12.75 4.605 12.75 7.5C12.75 10.395 10.395 12.75 7.5 12.75C4.605 12.75 2.25 10.395 2.25 7.5V7.5Z" fill="#01A3FF" />
                                            </svg>
                                        </a></span>
                                </div>
                                <div>

                                    <!-- Button trigger modal -->
                                    <button type="button" class="btn btn-primary" id="open-modal">
                                        + New Exam Schedule
                                    </button>
                                </div>
                            </div>
                        </div>
                        <!--column-->
                        <div class="col-xl-12 wow fadeInUp" data-wow-delay="1.5s">
                            <div class="table-responsive full-data">
                                <table class="table-responsive-lg table display dataTablesCard student-tab dataTable no-footer" id="example-student">
                                    <thead>

                                        <tr>
                                            <th class="wd-20p">S.No</th>
                                            <th class="wd-20p">Academic</th>
                                            <th class="wd-25p"> Exam Schedule </th>
                                            <th class="wd-25p">Objective Date</th>
                                            <th class="wd-25p">Objective Time</th>
                                            <th class="wd-25p">Essay Date</th>
                                            <th class="wd-25p">Essay Time</th>
                                            <th class="wd-15p">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                        $i = 1;
                                        foreach ($records as $key => $row) {
                                        ?>
                                            <tr>
                                                <td><?= $i ?></td>
                                                <td><?= $row->academic ?></td>
                                                <td><?= $row->exam_schedule ?></td>
                                                <td><?= date($row->objective_date) ?></td>
                                                <td><?= $row->objective_time ?></td>
                                                <td><?= date($row->essay_date) ?></td>
                                                <td><?= $row->essay_time ?></td>      
                                                <td>
                                                    <a data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" onclick="edit('<?php echo $row->id; ?>', '<?php echo $row->academic; ?>', '<?php echo $row->exam_schedule; ?>','<?php echo $row->objective_date; ?>','<?php echo $row->objective_time; ?>','<?php echo $row->essay_date; ?>','<?php echo $row->essay_time; ?>')" class="btn btn-sm btn-info"><i class="ti ti-pencil"></i></a>
                                                    <a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" onclick="deleteCourse('<?php echo $row->id; ?>','<?php echo $row->status; ?>')" class="btn btn-sm  <?php echo $row->status == 1 ? 'btn-primary' : 'btn-danger' ?>  text-white"><?php echo $row->status == 1 ? 'Active' : 'In-Active' ?></a>
                                                </td>
                                            </tr>
                                        <?php $i++;
                                        }  ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="applicationModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg modal-dialog-center">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="formTitle">Add Exam Schedule </h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <form method="POST" id="feesForm" action="<?php echo base_url('ApplicationController/addEditexamSchedule'); ?>">
                        <input type="hidden" id='id' name='id'>

                        <div class="row">
                            <div class="form-group col-md-6">
                                <label class="tx-medium">Academic Year<span class="text-danger">*</span> </label>

                                <select name="academic" id="academic" class="form-control select2 modal-select">
                                    <option value="">--Select--</option>
                                    <?php foreach ($academic_year as $row) { ?>
                                        <option value="<?php echo $row->id ?>"> <?php echo $row->year ?></option>

                                    <?php } ?>
                                </select>
                            </div>


                            <div class="form-group col-md-6">
                                <label class="tx-medium">Exam Schedule <span class="text-danger">*</span> </label>
                                <input type="text" class="form-control" id="schedule" name="schedule" placeholder="Exam Schedule" required>
                                <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
                            </div>

                            <div class="form-group col-md-4 mt-3">
                                <label class="tx-medium">Exam Type<span class="text-danger">*</span> </label>

                                <select name="exam_type1" id="exam_type1" class="form-control select2 modal-select">
                                    <option value="">--Select--</option>
                                    <?php foreach ($exam_type as $row) { ?>
                                        <option value="<?php echo $row->id ?>"> <?php echo $row->exam_type_name ?></option>

                                    <?php } ?>
                                </select>
                            
                            </div>

                            <div class="form-group col-md-4 mt-3">
                                <label class="tx-medium">Objective Date <span class="text-danger">*</span> </label>
                                <input type="date" class="form-control" id="objective_date" name="objective_date" placeholder="Date" required>
                                <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
                            </div>

                            <div class="form-group col-md-4 mt-3">
                                <label class="tx-medium"> Objective Time <span class="text-danger">*</span> </label>
                                <input type="time" class="form-control" id="objective_time" name="objective_time" placeholder="Time" required>
                                <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
                            </div>

                            <div class="form-group col-md-4 mt-3">
                                <label class="tx-medium">Exam Type<span class="text-danger">*</span> </label>

                                <select name="exam_type2" id="exam_type2" class="form-control select2 modal-select">
                                    <option value="">--Select--</option>
                                    <?php foreach ($exam_type as $row) { ?>
                                        <option value="<?php echo $row->id ?>"> <?php echo $row->exam_type_name ?></option>

                                    <?php } ?>
                                </select>
                            
                            </div>

                            <div class="form-group col-md-4 mt-3">
                                <label class="tx-medium">Essay Date <span class="text-danger">*</span> </label>
                                <input type="date" class="form-control" id="essay_date" name="essay_date" placeholder="Date" required>
                                <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
                            </div>

                            <div class="form-group col-md-4 mt-3">
                                <label class="tx-medium"> Essay Time <span class="text-danger">*</span> </label>
                                <input type="time" class="form-control" id="essay_time" name="essay_time" placeholder="Time" required>
                                <!-- <p class="text-danger mt-2" id="fees_err"></p> -->
                            </div>
                        </div>

                        <div class="modal-footer">
                            <button type="submit" class="btn ripple btn-primary" id="save">Save</button>
                            <button type="button" class="btn ripple btn-secondary " id="closemodel" data-bs-dismiss="modal">Close</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="modal show" id="statusModal" style="display: none;" aria-modal="true" role="dialog">
        <div class="modal-dialog " role="document">
            <div class="modal-content modal-content-demo">
                <div class="modal-header">
                    <h6 class="modal-title" id="formTitle">Change Status</h6>

                </div>
                <div class="modal-body">
                    <form method="POST" action="<?php echo base_url('ApplicationController/commonStatusChange/') ?>" id="courseForm">
                        <input type="hidden" id='rowId' name='id'>
                        <input type="hidden" id='rowStatus' name='status'>
                        <input type="hidden" id='table' name='table' value="exam_schedule">
                        <div class="form-group">
                            <h4>Are You Sure you want to change the status?</h4>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn ripple btn-primary">Yes</button>
                            <button type="button" class="btn ripple btn-secondary closemodel" id="closemodel" data-bs-dismiss="modal">Close</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>



</body>

</html>

<script>
    function edit(id, academic,schedule,objective_date,objective_time,essay_date,essay_time) {

        $('#id').val(id)
        $('#academic').val(academic)
        $('#schedule').val(schedule )
        $('#objective_date').val(objective_date)
        $('#objective_time').val(objective_time)
        $('#essay_date').val(essay_date)
        $('#essay_time').val(essay_time)
        $('#formTitle').text('Edit  Exam Schedule')
        $(".select").trigger("change"); 
        $("#applicationModal").modal('show');
        $("#courseId").select2({
            width: '100%',
        });

    }

    function deleteCourse(id, status) {

        $('#rowId').val(id)
        $('#rowStatus').val(status)
        $("#statusModal").show();
    }

    $('#open-modal').on('click', function() {

        $("#applicationModal").modal('show');
    });

    $('.closemodel').on('click', function() {

        $("#statusModal").hide();
    });

    $(document).ready(function() {
    $('#timepicker').timepicker({
        timeFormat: 'HH:mm:ss',
        interval: 30, // 30 minutes
        minTime: '10',
        maxTime: '12:00pm',
        defaultTime: '11',
        startTime: '10:00',
        dynamic: false,
        dropdown: true,
        scrollbar: true
    });
});
</script>