D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
www
/
grievance
/
sys_admin
/
application
/
controllers
/
admin
/
Filename :
MiscellaneousReports.php
back
Copy
<?php /** * Controller For Handling All Reuquests Related To Reports * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class MiscellaneousReports extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->library('session'); $this->load->model("admin/UserManagement"); $this->load->model("admin/CourseManagement"); $this->load->model("admin/GrievanceCategoriesManagement"); $this->load->model("admin/GrievanceManagement"); } public function users() { if ($this->session->userdata('logged_in')) { $viewData['allUsers'] = $this->UserManagement->getAllUsers('', '')->result(); $this->load->view('admin/users', $viewData); } else { redirect("admin/"); } } public function gCellMembers() { if ($this->session->userdata('logged_in')) { $viewData['allUsers'] = $this->UserManagement->getAllUsers('', 'GCM')->result(); $this->load->view('admin/gc_members', $viewData); } else { redirect("admin/"); } } public function courses() { if ($this->session->userdata('logged_in')) { $viewData['allCourses'] = $this->CourseManagement->getAllCourses()->result(); $this->load->view('admin/courses', $viewData); } else { redirect("admin/"); } } public function grievanceCategories() { if ($this->session->userdata('logged_in')) { $viewData['allGrvncCategories'] = $this->GrievanceCategoriesManagement->getAllGrievanceCategories()->result(); $this->load->view('admin/grievance_catgs', $viewData); } else { redirect("admin/"); } } public function getUserFulllInfoBy() { $cau_id = $_POST['cau_id']; $type = $_POST['type']; $signUpBy = ""; if ($type == 'typeWise') { $signUpBy = "Self"; $institute_admin_info = $this->UserManagement->getOnlyUsersFullInfo($cau_id)->result()[0]; } else { $institute_admin_info = $this->UserManagement->getOnlyGCellMgmtMembersFullInfo($cau_id)->result()[0]; $signUpBy = "IA On " . date('d-m-Y h:i:s A', strtotime($institute_admin_info->cau_signup_on)); } $gender = "-"; $userType = "-"; $userRole = "-"; $courseName = "-"; $uIdLabel = "-"; $allottedGCats = "-"; if ($institute_admin_info->cau_gender == "M") { $gender = "Male"; } else { if ($institute_admin_info->cau_gender == "F") { $gender = "Female"; } else { $gender = "Other"; } } if ($institute_admin_info->cau_user_type_flag == "S") { $userType = "Student"; $uIdLabel = "Reg./Admsn./Roll No."; $courseInfo = $this->CourseManagement->getCourseInfoById($institute_admin_info->course_id)->result()[0]; $courseName = $courseInfo->course_name; } else if ($institute_admin_info->cau_user_type_flag == "P") { $userType = "Parent"; $uIdLabel = "Ward's Reg./Admsn./Roll No."; } else if ($institute_admin_info->cau_user_type_flag == "N") { $userType = "Non-Teaching"; $uIdLabel = "Emp. Code/No."; } else if ($institute_admin_info->cau_user_type_flag == "F") { $userType = "Teaching/Faculty"; $uIdLabel = "Emp. Code/No."; } else { $userType = $institute_admin_info->cau_user_type_flag; $uIdLabel = "NA."; } if ($institute_admin_info->cau_user_role_flag == "CA") { $userRole = "Institute-Admin"; } else if ($institute_admin_info->cau_user_role_flag == "GCM") { $gcAllottedHeadsArray = array(); $allottedGCInfo = $this->GrievanceCategoriesManagement->getAllottedGCToUesrFullInfo($institute_admin_info->cau_id)->result(); for ($gcAllotInfo = 0; $gcAllotInfo < sizeof($allottedGCInfo); $gcAllotInfo++) { array_push($gcAllottedHeadsArray, $allottedGCInfo[$gcAllotInfo]->gcm_title); } $allottedGCats = implode('-*-', $gcAllottedHeadsArray); $userRole = "G-Cell Memeber"; } else { $userRole = $institute_admin_info->cau_user_role_flag; } $responseData = array( 'csrfName' => $this->security->get_csrf_token_name(), 'csrfHash' => $this->security->get_csrf_hash(), 'cau_id' => $institute_admin_info->cau_id, 'cau_first_name' => $institute_admin_info->cau_first_name, 'cau_last_name' => $institute_admin_info->cau_last_name, 'cau_email' => $institute_admin_info->cau_email, 'cau_mobile' => $institute_admin_info->cau_mobile, 'cau_alt_email' => ($institute_admin_info->cau_alt_email == "") ? "NA" : $institute_admin_info->cau_alt_email, 'cau_alt_mobile' => ($institute_admin_info->cau_alt_mobile == "") ? "NA" : $institute_admin_info->cau_alt_mobile, 'cau_mobile_verify_status' => ($institute_admin_info->cau_mobile_verify_status == "T") ? "Yes" : "No", 'cau_email_verify_status' => ($institute_admin_info->cau_email_verify_status == "T") ? "Yes" : "No", 'cau_gender' => $gender, 'cau_course_complete_on' => ($institute_admin_info->cau_course_complt_on == NULL) ? "-" : date('d-m-Y', strtotime($institute_admin_info->cau_course_complt_on)), 'cau_course_name' => $courseName, 'cau_parent_of' => '-', 'cau_allotted_gcats' => $allottedGCats, 'cau_adm_emp_id' => ($institute_admin_info->cau_adm_reg_roll_no == "" || $institute_admin_info->cau_adm_reg_roll_no == NULL) ? "NA" : $uIdLabel . ":" . $institute_admin_info->cau_adm_reg_roll_no, 'cau_signup_by' => $signUpBy, 'cau_sa_operation_by' => $signUpBy, 'cau_signup_on' => date('d-m-Y h:i:s A', strtotime($institute_admin_info->cau_signup_on)), 'cau_ca_operation_on' => date('d-m-Y h:i:s A', strtotime($institute_admin_info->cau_last_updated_on)), 'cau_user_type_flag' => $userType, 'cau_user_role_flag' => $userRole, 'cau_image_url' => $institute_admin_info->cau_image_url, 'cau_auth_sms_flag' => ($institute_admin_info->cau_auth_sms_flag == 'T') ? "SMS Allowed" : "SMS Not Allowed", 'cau_approve_status' => ($institute_admin_info->cau_approve_status == 'T') ? "Approved" : "Approval Pending", 'cau_delete_status' => ($institute_admin_info->cau_delete_status == 'T') ? "Deleted" : "-", 'cau_block_status' => ($institute_admin_info->cau_block_status == 'F') ? "Unblocked" : "Blocked", 'clg_name' => $institute_admin_info->clg_name ); echo json_encode($responseData); } public function grievances() { if ($this->session->userdata('logged_in')) { $viewData['allGrievances'] = $this->GrievanceManagement->getAllGrievances()->result(); $this->load->view('admin/grievances', $viewData); } else { redirect("admin/"); } } public function getGrievanceFulllInfo() { $gm_id = $_POST['gm_id']; $grievance_info = $this->GrievanceManagement->getGrievanceInfoById($gm_id)->result()[0]; $currentStatus = "-"; $course = "-"; $semOrYear = "-"; $viewedBy = "-"; $acknowledgedBy = "-"; $lockedBy = "-"; $resolvedBy = "-"; $userType = "-"; $uIdLabel = "-"; if ($grievance_info->gm_current_status == "P") { $currentStatus = "Pending"; } else if ($grievance_info->gm_current_status == "A") { $currentStatus = "Acknowledged"; } else if ($grievance_info->gm_current_status == "V") { $currentStatus = "Viewed"; } else if ($grievance_info->gm_current_status == "IP") { $currentStatus = "In-Progress"; } else if ($grievance_info->gm_current_status == "R") { $currentStatus = "Resolved/Closed"; } else if ($grievance_info->gm_current_status == "DL") { $currentStatus = "Refused"; } else { $currentStatus = "Re-Opened"; } if ($grievance_info->cau_user_type_flag == "S" && $grievance_info->cau_user_role_flag == "NA") { $courseInfo = $this->CourseManagement->getCourseInfoById($grievance_info->gm_course_id)->result()[0]; $course = $courseInfo->course_name; $semOrYear = $grievance_info->gm_course_ysem; $userType = "Student"; $uIdLabel = "Reg./Admsn./Roll No."; } else if ($grievance_info->cau_user_type_flag == "P" && $grievance_info->cau_user_role_flag == "NA") { $userType = "Parent"; $uIdLabel = "Ward's Reg./Admsn./Roll No."; } else if ($grievance_info->cau_user_type_flag == "F" && $grievance_info->cau_user_role_flag == "NA") { $userType = "Faculty"; $uIdLabel = "Emp. Code/No."; } else if ($grievance_info->cau_user_type_flag == "N" && $grievance_info->cau_user_role_flag == "NA") { $userType = "Non-Teaching Staff"; $uIdLabel = "Emp. Code/No."; } else { $userType = "Other"; } if ($grievance_info->gm_viewed_by != NULL || $grievance_info->gm_viewed_by != "") { $viewerInfo = $this->UserManagement->getUserInfoBy($grievance_info->gm_viewed_by)->result()[0]; $viewedBy = $viewerInfo->cau_first_name . " " . $viewerInfo->cau_last_name; } if ($grievance_info->gm_acknowledge_by != NULL || $grievance_info->gm_acknowledge_by != "") { $acknowledgerInfo = $this->UserManagement->getUserInfoBy($grievance_info->gm_acknowledge_by)->result()[0]; $acknowledgedBy = $acknowledgerInfo->cau_first_name . " " . $acknowledgerInfo->cau_last_name; } if ($grievance_info->gm_locked_by != NULL || $grievance_info->gm_locked_by != "") { $lockedByInfo = $this->UserManagement->getUserInfoBy($grievance_info->gm_locked_by)->result()[0]; $lockedBy = $lockedByInfo->cau_first_name . " " . $lockedByInfo->cau_last_name; } if ($grievance_info->gm_resolved_by != NULL || $grievance_info->gm_resolved_by != "") { $resolvedByInfo = $this->UserManagement->getUserInfoBy($grievance_info->gm_resolved_by)->result()[0]; $resolvedBy = $resolvedByInfo->cau_first_name . " " . $resolvedByInfo->cau_last_name; } $responseData = array( 'csrfName' => $this->security->get_csrf_token_name(), 'csrfHash' => $this->security->get_csrf_hash(), 'gm_id' => $grievance_info->gm_disp_id, 'gm_category' => $grievance_info->gcm_title, 'gm_disp_id' => $grievance_info->gm_disp_id, 'gm_subject' => $grievance_info->gm_subject, 'gm_description' => $grievance_info->gm_description, 'gm_file_one' => ($grievance_info->gm_file_one == "" || $grievance_info->gm_file_one == NULL) ? "-" : "<a href='" . $grievance_info->gm_file_one . "' target='_blank'>Click To View</a>", 'gm_file_two' => ($grievance_info->gm_file_two == "" || $grievance_info->gm_file_two == NULL) ? "-" : "<a href='" . $grievance_info->gm_file_two . "' target='_blank'>Click To View</a>", 'gm_delete_status' => ($grievance_info->gm_delete_status == "T") ? "Deleted By Initiator" : "-", 'gm_current_status' => $currentStatus, 'gm_reg_emp_no' => $uIdLabel . ":" . $grievance_info->cau_adm_reg_roll_no, 'gm_submitter_img' => $grievance_info->cau_image_url, 'gm_user_type' => $userType, 'gm_course' => $course, 'gm_sem_or_year' => $semOrYear, 'gm_submitted_by' => $grievance_info->cau_first_name . " " . $grievance_info->cau_last_name, 'gm_submitted_on' => ($grievance_info->gm_submitted_on == NULL || $grievance_info->gm_submitted_on == "") ? "-" : date('d-m-Y h:i:s A', strtotime($grievance_info->gm_submitted_on)), 'gm_viewed_by' => $viewedBy, 'gm_viewed_on' => ($grievance_info->gm_viewed_on == NULL || $grievance_info->gm_viewed_on == "") ? "-" : date('d-m-Y h:i:s A', strtotime($grievance_info->gm_viewed_on)), 'gm_acknowledge_by' => $acknowledgedBy, 'gm_acknowledge_on' => ($grievance_info->gm_acknowledge_on == NULL || $grievance_info->gm_acknowledge_on == "") ? "-" : date('d-m-Y h:i:s A', strtotime($grievance_info->gm_acknowledge_on)), 'gm_locked_by' => $lockedBy, 'gm_locked_on' => ($grievance_info->gm_locked_on == NULL || $grievance_info->gm_locked_on == "") ? "-" : date('d-m-Y h:i:s A', strtotime($grievance_info->gm_locked_on)), 'gm_resolved_by' => $resolvedBy, 'gm_resolved_on' => ($grievance_info->gm_resolved_on == NULL) ? "-" : $grievance_info->gm_resolved_on, 'gm_updated_on' => date('d-m-Y h:i:s A', strtotime($grievance_info->gm_updated_on)), 'clg_name' => $grievance_info->clg_name ); echo json_encode($responseData); } }