D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
alumni
/
application
/
controllers
/
user
/
Filename :
Feedback.php
back
Copy
<?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"); } } }