File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/application/modules/core/controllers/Message.php
Back
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Message extends MY_Controller { function __construct() { parent::__construct(); //$this->load->model('Inbox_model'); } function inbox() { if($this->session->userdata("user_id")) { $data = $this->data; $this->load->library('mahana_messaging'); $data['msg'] = $this->mahana_messaging->get_all_threads_grouped($this->session->userdata("id"),TRUE); $data['count'] = $this->mahana_messaging->get_msg_count($this->session->userdata("id")); $data['users'] = $this->User_model->getUsers(); $data['header'] = TRUE; $data['sidebar'] = TRUE; $data['_view'] = "message/inbox"; $data['quickbar'] = TRUE; $data['footer'] = TRUE; $data['pagetitle'] = "Enable Disable Modules"; $this->load->view('basetemplate', $data); } else { redirect("login"); } } function get_thread() { if($this->session->userdata("user_id")) { $this->load->library('mahana_messaging'); // echo $this->input->post('msg_id'); // echo $this->session->userdata("id"); $msg = $this->mahana_messaging->get_full_thread($this->input->post('msg_id'),$this->session->userdata("id"),true); echo json_encode($msg); } else { redirect("login"); } } function get_message() { if($this->session->userdata("user_id")) { $this->load->library('mahana_messaging'); // echo $this->input->post('msg_id'); // echo $this->session->userdata("id"); $msg = $this->mahana_messaging->get_message($this->input->post('msg_id'),$this->session->userdata("id")); $this->mahana_messaging->update_message_status($this->input->post('msg_id'),$this->session->userdata("id"),1); echo json_encode($msg); } else { redirect("login"); } } function get_message_count() { if($this->session->userdata("user_id")) { $this->load->library('mahana_messaging'); // echo $this->input->post('msg_id'); // echo $this->session->userdata("id"); $count = $this->mahana_messaging->get_msg_count($this->session->userdata("id")); echo json_encode($count); } else { redirect("login"); } } function send_message() { if($this->session->userdata("user_id")) { $this->load->library('mahana_messaging'); // echo $this->input->post('msg_id'); // echo $this->session->userdata("id"); // send_new_message($sender_id, $recipients, $subject = '', $body = '', $priority = PRIORITY_NORMAL)/ $recipients = $this->input->post('recipient-name'); foreach($recipients as $recipient) { $user = $this->User_model->getUser($recipient); $body = $this->input->post('message-text'); $body = preg_replace("/[\n\r]/",'<br/>',$body); if(!empty($user['id'])){ if($this->mahana_messaging->send_new_message($this->session->userdata("id"),$user['id'],$this->input->post('subject'),$body)){ echo TRUE; } else { echo "unknow error"; } } else { echo "User not found"; } } } else { redirect("login"); } } function reply_message() { if($this->session->userdata("user_id")) { $this->load->library('mahana_messaging'); // echo $this->input->post('msg_id'); // echo $this->session->userdata("id"); // reply_to_message($msg_id, $sender_id, $subject = '', $body = '', $priority = PRIORITY_NORMAL) $user = $this->User_model->getUser($this->input->post('recipient-id')); $body = $this->input->post('message-text'); $body = preg_replace("/[\n\r]/",'<br/>',$body); if(!empty($user['id'])){ if($this->mahana_messaging->reply_to_message($this->input->post('msg-id'), $this->session->userdata("id"),$this->input->post('subject'),$body)){ echo TRUE; } else { echo "unknow error"; } } else { echo "User not found"; } } else { redirect("login"); } } function forward_message() { if($this->session->userdata("user_id")) { $this->load->library('mahana_messaging'); echo $this->input->post('thread-id'); echo $this->input->post('recipient-id'); // add_participant($thread_id, $user_id) $recipients = $this->input->post('recipient-name'); foreach($recipients as $recipient) { $user = $this->User_model->getUser($recipient); if(!empty($user['id'])){ if($return = $this->mahana_messaging->add_participant($this->input->post('thread-id'),$user['id'])){ echo TRUE; } else { echo $return; } } } } else { redirect("login"); } } }
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.13 |
proxy
|
phpinfo
|
Settings